#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, best, K;
  cin >> n;
  best = 10 * n;
  for (int k = 1; k <= n; k++) {
    if (k + (n + k - 1) / k < best) {
      best = k + (n + k - 1) / k;
      K = k;
    }
  }
  for (int i = n - K + 1; i >= -2 * K; i -= K)
    for (int j = 0; j < K; j++) {
      if (i + j > 0) cout << i + j << " ";
    }
  return 0;
}
