#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 9;
const int Maxmask = 1953124 + 10;
const int Mod = 1000000007;
int main() {
  int n;
  cin >> n;
  int Min = 3 * n, f = -1;
  for (int i = 1; i <= n; i++) {
    int tmp = i + n / i;
    if (n % i != 0) tmp++;
    if (tmp < Min) {
      Min = tmp;
      f = i;
    }
  }
  vector<int> ans;
  for (int i = 1; i <= n; i += f) {
    for (int j = min(i + f - 1, n); j >= i; j--) ans.push_back(j);
  }
  for (int i = n - 1; i >= 0; i--) {
    printf("%d ", ans[i]);
  }
}
