#include <bits/stdc++.h>
using namespace std;
struct abc {
  long long int val, ind;
};
bool compare(abc x1, abc x2) { return (x1.val < x2.val); }
long long int a[100005];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int k = sqrt(n);
  for (long long int i = 0; i < n; i += k) {
    for (long long int j = min(i + k, n); j > i; j--) cout << j << ' ';
  }
}
