#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
void Init() {
  int num = 1;
  for (int i = 2; i <= 1e5; i++) {
    if (i >= (num + 1) * (num + 1)) num++;
    mp[i] = num;
  }
}
int main() {
  int n;
  Init();
  while (~scanf("%d", &n)) {
    if (n == 1) {
      printf("1\n");
      continue;
    }
    int pp = n / mp[n];
    if (n % mp[n] != 0) pp++;
    int num = n;
    for (int i = 1; i < pp; i++) {
      for (int i = num - mp[n] + 1; i <= num; i++) printf("%d ", i);
      num = num - mp[n];
    }
    for (int i = 1; i < num; i++) printf("%d ", i);
    printf("%d\n", num);
  }
  return 0;
}
