import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;
import std.numeric;


void main() {
    int n;
    scan(n);

    if (n > 1000) return;

    auto dp = new bool[][](n + 1,n + 1);
    dp[0][0] = 1;

    void writeans(int i) {
        int k = n;

        while (k > 0) {
            if (k - i >= 0 && dp[i - 1][k - i]) {
                writeln(i);
                k -= i;
            }

            i--;
        }
    }

    foreach (i ; 1 .. n + 1) {
        foreach (j ; 0 .. n + 1) {
            dp[i][j] = dp[i - 1][j];

            if (j - i >= 0 && dp[i - 1][j - i]) {
                dp[i][j] = 1;
            }
        }

        debug {
            writeln(dp);
        }

        if (dp[i][n]) {
            writeans(i);
            return;
        }
    }
}



void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}