#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
void solve() {
  int n, mod = INF, v, u, k;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return;
  }
  if (n == 2) {
    cout << 1 << " " << 2;
    return;
  }
  if (n == 3) {
    cout << 2 << " " << 3 << " " << 1;
    return;
  }
  for (int i = n / 2; i >= 2; i--) {
    k = n % i == 0 ? 0 : 1;
    if ((n / i) + k + i < mod) {
      u = (n / i) + k;
      mod = u + i;
      v = i;
    }
  }
  int sup = n - v + 1, step = sup;
  for (int i = 0; i < n; i++) {
    cout << step << " ";
    if (step == sup + v - 1) {
      sup = sup - v;
      step = sup - 1;
      if (step < 0) step = 0;
    }
    step++;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  solve();
}
