#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int sq = sqrt(n);
    for (int i = n; i >= 1; i -= sq) {
      if (i <= sq) {
        for (int j = 1; j <= i; ++j) {
          printf("%d%c", j, " \n"[j == i]);
        }
      } else {
        for (int j = i - sq + 1; j <= i; ++j) {
          printf("%d ", j);
        }
      }
    }
  }
  return 0;
}
