#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  int m = int(sqrt(n));
  int nm = n / m;
  int re = nm * m;
  for (int i = nm * m + 1; i <= n; i++) printf("%d ", i);
  for (int i = 1; i <= nm; i++) {
    for (int j = 1; j <= m; j++) printf("%d ", m * (nm - i) + j);
  }
  return 0;
}
