#include <bits/stdc++.h>
using namespace std;
int n, i, j;
vector<int> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int val;
  val = sqrt(n);
  if (val * val != n) val++;
  for (i = 1; i <= n; i += val) {
    v.push_back(i);
  }
  reverse(v.begin(), v.end());
  v.push_back(0);
  for (i = 0; i < v.size() - 1; i++) {
    for (j = v[i]; j <= n && j < v[i] + val; j++) {
      cout << j << " ";
    }
  }
  return 0;
}
