#include <bits/stdc++.h>
using namespace std;
int n, mini = 1e9, minik, l, lm;
int main() {
  cin >> n;
  for (int k = 1; k <= n; k++)
    if (mini > (k + (n + k - 1) / k)) mini = (k + (n + k - 1) / k), minik = k;
  l = 0;
  for (int i = 1; i <= minik; i++) {
    int j = i * (n / minik);
    if (i > minik - (n % minik)) j += i - (minik - (n % minik));
    lm = j;
    for (; j > l; j--) cout << j << ' ';
    l = lm;
  }
}
