from scipy.special import comb x = int(input()) if x > 31: print(0, 0) exit() ans1 = comb(31, x, True) ans2 = (2 ** 31 - 1) * comb(30, x - 1, True) print(ans1, ans2)