#include <bits/stdc++.h>
using namespace std;
int n;
int f(int x) { return ((n + x - 1) / x + x); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int m1 = (int)floor(sqrt((float)n));
  int m2 = (int)ceil(sqrt((float)n));
  int m3 = max(1, m1 - 1);
  int m4 = min(n, m2 + 1);
  vector<pair<int, int> > v;
  v.push_back(make_pair(f(m1), m1));
  v.push_back(make_pair(f(m2), m2));
  v.push_back(make_pair(f(m3), m3));
  v.push_back(make_pair(f(m4), m4));
  sort(v.begin(), v.end());
  int m = v[0].second;
  int c = n;
  int x = (n + (m - 1)) / m;
  while (m > 0) {
    for (int i = max(c - x + 1, 1); i <= c; i++) {
      cout << i << " ";
    }
    c -= x;
    m--;
  }
  cout << endl;
}
