#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  int div = floor(sqrt(n)), inc = 1;
  while (n > 0) {
    int sub = 0;
    if (n - div + 1 > 0) {
      for (int i = n - div + 1; i <= n; i++) {
        printf("%d ", i);
        sub++;
      }
    } else {
      for (int i = 1; i <= n; i++) {
        printf("%d ", i);
        sub++;
      }
    }
    n -= sub;
  }
  return 0;
}
