#include <bits/stdc++.h>
const int maxn = 100035;
int a[maxn], n, size, tot;
int main() {
  scanf("%d", &n);
  size = sqrt(n);
  for (int i = size; i < n; i += size)
    for (int j = i; j >= i - size + 1; j--) a[j] = ++tot;
  for (int i = n; tot < n; i--) a[i] = ++tot;
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
