#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int A = 1;
  while (A * A < n) A++;
  while (n > 0) {
    int x = ((n - 1) / A) * A;
    for (int i = x + 1; i <= n; i++) printf("%d ", i);
    n = x;
  }
  printf("\n");
  return 0;
}
