#include <bits/stdc++.h>
using namespace std;
void func() {
  long long n;
  cin >> n;
  long long strt, end = n;
  long long grp = ceil(sqrt(n)) - 1;
  strt = end - grp;
  while (1) {
    for (int i = strt; i <= end; i++) cout << i << " ";
    end = strt - 1;
    strt = end - grp;
    if (strt <= 0) strt = 1;
    if (end <= 0) break;
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) func();
}
