#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<int> v(n);
  long long s = INT_MAX, k, l, cur;
  for (int i = 1; i < n + 1; i++) {
    cur = i + (n / i) + (n % i == 0 ? 0 : 1);
    if (cur < s) {
      k = i;
      s = cur;
    }
  }
  long long j = 0, p = 1;
  while (p <= n) {
    long long q = p + k - 1;
    if (q >= n) q = n;
    while (q >= p) {
      v[j] = q;
      q--;
      j++;
    }
    p += k;
    if (j >= n) break;
  }
  reverse(v.begin(), v.end());
  for (int i = 0; i < n; i++) cout << v[i] << " ";
  cout << endl;
}
