weights = [512, 256, 128, 64, 32, 16, 8, 4, 2, 1]

$<.each_line do |line|
  g = line.to_i
  a = []
  weights.each{|weight|
    if weight <= g
      a.push weight
      g -= weight
    end
  }
  puts a.sort.join(" ")
end