x = int(input()) import sys if x > 31: print(0,0) exit() if x == 0: print(1,0) exit() ans = 0 comb = 1 for i in range(x- 1): comb *= (30 - i) for i in range(x - 1): comb //= (i + 1) for i in range(31): ans += (1 << i) * comb count = comb * 31 // x print(count,ans)