open System

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

    let readInts() =
        read string
        |> Seq.toArray
        |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<EntryPoint>]
let main _ =
    let N = read int
    let lim = int 1e7 + 1
    let dp = Array.zeroCreate lim
    dp.[0] <- [ 0 ]
    dp.[1] <- [ 1 ]
    dp.[2] <- [ 2 ]
    dp.[3] <- [ 1; 2 ]
    dp.[4] <- [ 1; 3 ]
    for n in 5 .. lim - 1 do
        if n % 2 = 0 then
            let m = n / 2
            dp.[n] <- m :: dp.[m]
        else
            let m = n / 2
            dp.[n] <- [ m
                        m + 1 ]

    dp.[N] |> List.iter (fun l -> printfn "%d" l)
    0 // return an integer exit code
