#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  if (n == 1)
    cout << "1\n";
  else {
    int ans = 2 * n + 1, grup = -1;
    for (int i = 1; i <= n; i++) {
      int lis = (i + (n / i) + (n % i > 0));
      if (lis < ans) {
        ans = lis;
        grup = i;
      }
    }
    vector<int> v(n);
    for (int j = 0; j < n; j++) v[j] = j + 1;
    int pos = 0;
    while (pos < n) {
      int fi = pos + grup;
      if (fi <= n)
        reverse(v.begin() + pos, v.begin() + pos + grup);
      else
        reverse(v.begin() + pos, v.end());
      pos += grup;
    }
    for (int i = 0; i < n; i++) cout << v[i] << (char)(i + 1 == n ? 10 : 32);
  }
  return 0;
}
