#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int n;
  cin >> n;
  long long Min = (long long)1e18;
  int x;
  for (int i = 1; i <= n; ++i) {
    if (i + (n / i) < Min) Min = i + ((n + i - 1) / i), x = i;
  }
  int ahoo00oo = n - x + 1;
  int limit = (n / x) * x;
  for (int i = 1; i <= limit; ++i) {
    cout << ahoo00oo++ << " ";
    if (i % x == 0 && i != limit) ahoo00oo -= (2 * x);
  }
  ahoo00oo = 1;
  for (int i = limit + 1; i <= n; ++i) cout << ahoo00oo++ << " ";
  return 0;
}
