#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int y = sqrt(n);
  int k = 0;
  int r = 1, i;
  for (i = y * r; i <= n; i--) {
    cout << i << " ";
    k++;
    if (k == y) {
      k = 0;
      r++;
      i = y * r + 1;
    }
  }
  while (i > y * (r - 1)) {
    i--;
    if (i == y * (r - 1)) break;
    if (i <= n) cout << i << " ";
  }
  return 0;
}
