import math x = int(input()) if x == 0: print(1, 0) elif x < 0 or x > 31: print(0, 0) else: count = math.comb(31, x) c = math.comb(30, x - 1) total_sum = c * (2**31 - 1) print(count, total_sum)