#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 1; i <= n; i++) A[i - 1] = i;
  reverse(A.begin(), A.end());
  int sz = sqrt(n);
  for (int i = 0; i <= n; i += sz)
    reverse(A.begin() + i, A.begin() + min(i + sz, n));
  for (int& x : A) cout << x << " ";
}
