#include <bits/stdc++.h>
using namespace std;
deque<int> ans;
int main() {
  int n;
  cin >> n;
  int jump = floor(sqrt(n));
  for (int i = n; i > 0; i -= jump) {
    for (int j = max(1, i - jump + 1); j <= i; j++) ans.push_front(j);
  }
  cout << ans[0];
  for (int i = 1; i < n; i++) cout << ' ' << ans[i];
  cout << '\n';
  return 0;
}
