# Author: Manfred Scheucher
# Date  : 23.06.2015 

def s(n):
	return sum(1/factorial(k) for k in [0..n])

for n in [1..20]:
	x=s(n)
	y=s(n+1)
	d = 1
	while True:
		c = ceil(x*d)
		if c/d < y: 
			print n,d
			break
		d+=1