while number = gets
    number = number.to_i
    weights = []
    count = 1

    until number == 0
        if number % 2 == 1
            weights << count
        end
        number /= 2
        count *= 2
    end
    puts weights.join(" ")
end