#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  if (n < 3) {
    for (int i = 1; i <= n; i++) cout << i << " ";
    cout << endl;
    return 0;
  }
  int sq = 1;
  while (sq * sq < n) sq++;
  for (int i = 1; i <= n; i += sq)
    for (int j = min(n, i + sq - 1); j >= i; j--) cout << j << " ";
  cout << endl;
  return 0;
}
