N = gets.to_i def is_power_of_2(x) while x > 1 return false if x % 2 == 1 x /= 2 end true end 1.upto(200) do |a| next if is_power_of_2(a) b = N - a next if is_power_of_2(b) puts [a, b].join(' ') exit end puts -1