#include <bits/stdc++.h>
using namespace std;
ostream cnull(NULL);
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cnull << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cnull << *sdbg++;
  cnull << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
int32_t main() {
  int n;
  scanf("%d", &n);
  int sq = sqrt(n);
  int reszta = n % sq;
  for (int i = reszta - 1; i >= 0; --i) {
    printf("%d ", n - i);
  }
  for (int i = n / sq; i >= 1; --i) {
    for (int j = 0; j < sq; ++j) printf("%d ", (i - 1) * sq + j + 1);
  }
}
