#include <bits/stdc++.h>
using namespace std;
int n;
int a[200005];
int main() {
  scanf("%d", &n);
  int bz = (int)sqrt(n), bs = (n + bz - 1) / bz, tim = 0;
  for (int j = 1; j <= bz; ++j)
    for (int i = bs - 1; i != -1; --i)
      if (i * bz + j <= n) a[i * bz + j] = ++tim;
  for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  return 0;
}
