import math def comb(n, x): return math.factorial(n) // math.factorial(x) // math.factorial(n-x) x = int(input()) n = 31 if x == 0: print(1, 0) exit() elif x > 31: print(0, 0) exit() a = comb(n, x) b = comb(30, x-1) c = (pow(2, 31) - 1) * b print(a, c)