from functools import reduce def comb(n, r): if n < 0 or r < 0 or r > n: return 0 r = min(r, n - r) if r == 0: return 1 numer = [n - r + i + 1 for i in range(r)] denom = [i + 1 for i in range(r)] for i in range(1, r): divisor = denom[i] if divisor > 1: offset = (n - r) % (i + 1) for j in range(i, r, i+1): numer[j - offset] //= divisor denom[j] //= divisor return reduce(lambda x, y: x*y if y > 1 else x, numer) def main(): X = int(input()) if X == 0: print(0, 0) else: c = comb(31, X) s = c * X // 31 * (2**31 - 1) print(c, s) main()