import math x = int(input()) if x > 31: print(0,0) elif x == 0: print(1,0) else: kosu = math.factorial(31)//math.factorial(x)//math.factorial(31-x) souwa = math.factorial(30)//math.factorial(x-1)//math.factorial(31-x) * (2**31-1) print(kosu,souwa)