#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long res = 10000001, ri = -1;
  long long start = trunc(sqrt(n));
  while (!(n % start)) --start;
  for (long long i = ceil(sqrt(n)); i > 0; --i) {
    long long nup = ceil((double)n / (double)i);
    if (i + nup < res) {
      res = i + nup;
      ri = i;
    }
    if (!(n % i)) break;
  }
  long long cnum = n - ri + 1;
  for (long long i = 0; i < n; ++i) {
    printf("%lld ", cnum);
    if (!((n - cnum) % ri)) cnum -= (ri + ri);
    cnum++;
    if (cnum + ri - 1 <= 0) break;
    cnum = max(cnum, (long long)1);
  }
  printf("\n");
  return 0;
}
