#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  int p = sqrt(n);
  for (int j = n; j >= 1; j -= p)
    for (int i = j - p + 1; i <= j; i++) {
      if (i >= 1 && i <= n) cout << i << " ";
    }
}
