from scipy.special import comb x = int(input()) count = comb(31, x, exact = True) if x != 0: sum = 2147483647 * comb(30, x-1, exact = True) else: sum = 0 print(count, sum)