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

immutable long MOD = 10^^9 + 7;

void main() {
    auto N = readln.chomp.to!int;
    auto ans = new int[](N);

    int tmp = 1<<29;
    int x = 1;
    for (int i = 1; i <= N; ++i) {
        if (i + N/i + (N%i>0) < tmp) {
            tmp = i + N/i + (N%i>0);
            x = i;
        }
    }

    for (int i = 1, p = 0; p < N; i += x) {
        for (int j = min(N, i + x - 1); j >= i && p < N; --j, ++p) {
            ans[p] = j;
        }
    }

    ans.map!(to!string).join(" ").writeln;
}
