def comb n, r p=q=1 for i in 1..r p*=n+1-i q*=i end p/q end x=gets.to_i if x>31 puts "0 0" elsif x==0 puts "1 0" else res=0 31.times{|i| res+=2**i} puts "#{comb(31, x)} #{res*comb(30, x-1)}" end