#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x = sqrt(n), i, j;
  vector<vector<int> > ans;
  vector<int> tmp;
  for (i = n; i > 0; i -= x) {
    for (j = i; j >= i - x + 1 && j > 0; j--) {
      tmp.push_back(j);
    }
    reverse(tmp.begin(), tmp.end());
    ans.push_back(tmp);
    tmp.clear();
  }
  for (i = 0; i < ans.size(); i++) {
    for (j = 0; j < ans[i].size(); j++) cout << ans[i][j] << " ";
  }
  printf("\n");
  return 0;
}
