#include <bits/stdc++.h>
const int MAXN = 1123456;
const int MAXINT = 2147483640;
const long long MAXLL = 9223372036854775800LL;
const int MAXANS = 1000000007;
const int MOD = 1000000123;
const int MOD2 = 1000000321;
using namespace std;
int n;
int res(int d) {
  int q = d + n / d + bool(n % d);
  return q;
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  srand(time(0));
  int a, i, j, d, mn = MAXINT;
  cin >> n;
  for (i = 1; i * i <= n; i++) {
    int x = res(i);
    if (mn > x) mn = x, d = i;
  }
  for (i = 1; i <= d; i++) {
    a = (n / d) * i;
    for (j = 1; j <= n / d; j++) {
      cout << a << " ";
      a--;
    }
  }
  a = n;
  for (i = d * (n / d) + 1; i <= n; i++) {
    cout << a << " ";
    a--;
  }
  return 0;
}
