#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int sq = sqrt(n);
    int sq1 = sq;
    int r = n;
    int x = (n - sq * sq) % sq;
    int l = x;
    for (int i = 0; i < x; i++, l--) {
      printf("%d ", l);
    }
    sq += (n - sq * sq) / sq;
    l = x + sq1;
    for (int i = 0; i < sq; i++) {
      for (int j = 0; j < sq1; j++) {
        printf("%d ", l - j);
      }
      l += sq1;
    }
    printf("\n");
  }
  return 0;
}
