#include <bits/stdc++.h>
int n;
int zc(int x) {
  if (n % x)
    return n / x + 1 + x;
  else
    return n / x + x;
}
int main() {
  scanf("%d", &n);
  int nice = 1;
  for (int i = 1; i <= n; i++)
    if (zc(i) < zc(nice)) nice = i;
  int st = n % nice, ii = 0;
  for (int i = 1; i <= n; i++) {
    if (ii == nice || st - ii == 0) ii = 0, st += nice;
    printf("%d ", st - ii);
    ii++;
  }
}
