
#変数でなく定義で、クラス内参照おk
ARRAY = [512, 256 , 128, 64, 32, 16, 8, 4, 2, 1]

while tmp = gets
  break if tmp == nil
  tmp = tmp.to_i
  tmp_hash = Hash.new
  ARRAY.each do |i|
    if  tmp / i  > 0
      tmp_hash[i] =tmp / i
      tmp = tmp - (i * (tmp/i))
    else
      next
    end
  end
  #最終出力
  puts tmp_hash.keys.reverse.join(" ")
end
