class Weight
  def initialize
    @results = []
    while weight = $stdin.gets do 
      weight = weight.chomp.to_i
      @results << to_binary(weight)
    end

    @results.each do |binary|
      puts binary_to_integer(binary.reverse).join(' ')
    end
  end

  def to_binary(val)
    array = []
    while(val > 1) do
      array << val%2
      val /= 2
    end
    array << val
    array.reverse
  end

  def binary_to_integer(array)
    result = []
    array.each_with_index do |val, index|
      result.push(2**index) if val != 0
    end
    return result
  end
end

w = Weight.new