def weight
  master = Array.new(10) { |i| 2**i }
  all_res = []
  while gets
    w = $_.to_i
    spindles = master.select { |i| i < w }
    result = []
    # while true
    #   break if w == 0
    #   minus = spindles.max
    #   if minus > w
    #     spindles.delete(minus)
    #     next
    #   end
    #   w -= minus
    #   spindles.delete(minus)
    #   result << minus
    # end
    all_res << result.sort.join(' ')
  end
  return all_res
end

puts weight