#include <bits/stdc++.h>
using namespace std;
int minPrimeFactor(int);
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
  } else {
    int a = floor(sqrt(n));
    int diff = n % a;
    int p = n;
    for (int i = p - a + 1; i > 0; i -= a) {
      int t = i;
      for (int j = 0; j < a; j++) {
        cout << i << " ";
        i++;
      }
      i = t;
    }
    for (int i = 1; i <= diff; i++) {
      cout << i << " ";
    }
    cout << endl;
  }
  return 0;
}
