x = gets.to_i def c(n, k) return 1 if 0 == k % n c(n-1, k) + c(n-1, k-1) end cnt = c(31, x) sum = (1 <= x) ? ((2**31 - 1) * c(30, x-1)) : 0 puts "#{cnt} #{sum}"