#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int main() {
  int n;
  cin >> n;
  int best = 3 * n, k = -1;
  for (int i = 1; i <= n; ++i) {
    int j = (n + i - 1) / i;
    if (i + j < best) {
      best = i + j;
      k = i;
    }
  }
  int l = 1, sz = best - k;
  for (int i = 1; i <= k; ++i) {
    int r = min(n, l + sz - 1);
    for (int j = r; j >= l; --j) {
      cout << j << ' ';
    }
    l = r + 1;
  }
}
