n = int(input()) if n >= 40: print(0,0) exit() val = num = 1 for i in range(n): num *= 31-i num //= i+1 for i in range(n-1): val *= 30-i val //= i+1 print(num,(2**31-1)*val*(n>0))