N=gets.to_i n = (1..121).find{|i| [i, N-i].all?{|j| /^1?0*$|\./!~"%b"%j } } p n ? "#{n} #{N-n}" : -1