#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
  return;
}
int main() {
  int n = read(), ans = 0x3f3f3f3f, len = 1;
  for (int i = 1; i <= n; i++)
    if (ans > (n + i - 1) / i + i) ans = (n + i - 1) / i + i, len = i;
  int Les = n % len, cnt = n, f = 0, tmp;
  for (int i = 1; i <= n / len; i++) {
    cnt -= len, tmp = cnt;
    for (int j = 1; j <= len; j++) {
      if (f)
        printf(" %d", ++tmp);
      else
        f++, printf("%d", ++tmp);
    }
  }
  for (int i = 1; i <= Les; i++) printf(" %d", i);
  puts("");
  return 0;
}
