from scipy.special import comb from math import comb def main(): x = int(input()) if x > 31: print(0, 0) return if x == 0: print(1, 0) return patterns = comb(31, x) if x == 1 or x == 31: sum_ = 2**31 - 1 else: sum_ = (2**31 - 1) * comb(30, x-1) print(patterns, sum_) if __name__ == "__main__": main()