#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 10;
int main() {
  int n, j;
  cin >> n;
  int x = floor(sqrt(n));
  for (int i = n; i >= 1; i -= x) {
    if (i - x + 1 <= 0)
      j = 1;
    else
      j = i - x + 1;
    for (; j <= i; j++) cout << j << " ";
  }
  cout << endl;
  return 0;
}
