#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
char a[N], b[N];
int main() {
  int n;
  scanf("%d", &n);
  int m = sqrt(n);
  int cnt = 0;
  if (n <= 3) {
    for (int i = n; i >= 1; i--) printf("%d%c", i, i == 1 ? '\n' : ' ');
    return 0;
  }
  if (n % m != 0) {
    for (int i = n - n % m + 1; i <= n; i++) {
      cnt++;
      printf("%d%c", i, cnt == n ? '\n' : ' ');
    }
    int te = n / m;
    for (int i = te; i >= 1; i--) {
      for (int j = m * i - m + 1; j <= m * i - m + m; j++) {
        cnt++;
        printf("%d%c", j, cnt == n ? '\n' : ' ');
      }
    }
  } else {
    int te = n / m;
    for (int i = te; i >= 1; i--) {
      for (int j = m * i - m + 1; j <= m * i - m + m; j++) {
        cnt++;
        printf("%d%c", j, cnt == n ? '\n' : ' ');
      }
    }
  }
  return 0;
}
