#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const long long linf = 8e18 + 9e17;
const int mod = 1e9 + 7;
const double e = exp(1.0);
const double pi = acos(-1);
int main() {
  int mid, n, st;
  scanf("%d", &n);
  if (n == 2) {
    printf("2 1\n");
    return 0;
  }
  int block = (int)sqrt(n);
  if (block * block < n) block++;
  for (int i = n; i >= 1; i -= block) {
    for (int j = i - block + 1, h = 1; h <= block; h++, j++) {
      if (j > 0) printf("%d ", j);
    }
  }
  return 0;
}
