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