#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, i, j, k, n, x;
  scanf("%lld", &n);
  a = sqrt(n);
  vector<long long> v;
  x = a;
  for (i = n; i >= 1; i--) {
    if (x == 1) {
      x = a;
      v.push_back(i);
      reverse(v.begin(), v.end());
      for (j = 0; j < a; j++) printf("%lld ", v[j]);
      v.clear();
    } else {
      v.push_back(i);
      x--;
    }
  }
  reverse(v.begin(), v.end());
  for (i = 0; i < v.size(); i++) printf("%lld ", v[i]);
  return 0;
}
