x = gets.to_i if 0 == x puts '1 0' exit 0 end if 31 < x puts '0 0' exit 0 end 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 = (2**31 - 1) * c(30, x-1) puts "#{cnt} #{sum}"