#include <bits/stdc++.h>
int n;
std::vector<int> ans;
int main() {
  scanf("%d", &n);
  int l = round(sqrt(n));
  for (int i = 1; n - (i - 1) * l > 0; i++) {
    for (int j = n - i * l + 1; j <= n - (i - 1) * l; j++) {
      if (j > 0) ans.push_back(j);
    }
  }
  for (auto x : ans) {
    printf("%d ", x);
  }
  printf("\n");
}
