#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 100;
const long long mod = 1e9 + 7;
int n, m, k;
int a[maxn];
int f[maxn];
int main() {
  cin >> n;
  int t = 0, c;
  for (int i = n; i >= 1; i--) {
    t = round(sqrt(i));
    if (t * t == i) {
      break;
    }
  }
  int x = n;
  while (x > 0) {
    int s = x - t + 1;
    for (int j = 0; j < t; j++)
      if (s + j > 0) printf("%d ", s + j);
    x -= t;
  }
  return 0;
}
