file = $stdin
files = file.readlines
file.close
weights = [1,2,4,8,16,32,64,128,256,512]

files.each do | w |
	flug = nil
	(1..10).each do |i|
		weights.combination(i).each do |c|
			if c.reduce{|sum, n| sum + n} == w.to_i then
				c.each do |ans|
					print ans.to_s + " "
				end
				puts
				flug = true
				break
			end
			break if flug == true
		end
	end
end