n=gets.to_i.digits(2).reverse i=0 if n.count{|e| e==1}==1 then puts "-1 -1 -1" else as=["","",""] i=0 n.each{|e| s="000" if e==0 then elsif i%2==0 s="110" i+=1 else s="101" i+=1 end 3.times{|i| as[i]+=s[i] } } puts as.map{|e| e.to_i(2)}.sort.join(" ") end