#include <bits/stdc++.h>
using namespace std;
long long cmmdc(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lgput(long long cnt, long long mod, long long put) {
  long long r = 1, p = put;
  if (cnt == 0)
    return 1;
  else if (cnt < 0)
    return 0;
  while (cnt > 1) {
    if (!(cnt & 1)) {
      p = p * 1LL * p % mod;
      cnt >>= 1LL;
    } else {
      --cnt;
      r = r * 1LL * p % mod;
    }
  }
  p = p * 1LL * r;
  return p % mod;
}
int main() {
  long long l = 0, r = 0, n, t, i, j = 1, ca, cb, mn = 999999999999LL,
            mx1 = -10000000, mn1 = 9999999999, s = 0, pzx, pzn, k, x, y, z, cur,
            cn, cnt = 0, q, cj, ok = 1, ci, m;
  char cc;
  cin >> n;
  m = sqrt(n);
  for (i = 1; i <= n; ++i) {
    x = (i - 1) % m + 1;
    if (n - m * ((i - 1) / m + 1) > 0)
      cout << n - m * ((i - 1) / m + 1) + x << ' ';
    else
      cout << x << ' ';
  }
  return 0;
}
