#include <bits/stdc++.h>
using namespace std;
int n;
int compute(int len) { return ceil((double)n / len) + len; }
int main() {
  cin >> n;
  if (n == 2) {
    cout << 2 << " " << 1 << endl;
    return 0;
  }
  int min_val = INT_MAX;
  int min_pos = 1;
  for (int i = 1; i <= n; i++) {
    int cur_val = compute(i);
    if (cur_val < min_val) {
      min_val = cur_val;
      min_pos = i;
    }
  }
  int t = n;
  while (t > 0) {
    for (int i = min_pos - 1; i >= 0; i--) {
      if ((t - i) <= 0) continue;
      cout << t - i << " ";
    }
    t -= min_pos;
  }
  cout << endl;
}
