x = gets
until x.nil?
 y = x.to_i
 buntin = [512,256,128,64,32,16,8,4,2,1]
 weight = 0
 necebt = []
 buntin.each do |bt|
  if bt <= y
   necebt << bt
   y -= bt
  end
 end
 puts necebt.sort.join(" ")
 x = gets
end

