#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
using ul = uint64_t;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pi>;
static constexpr int inf = (int)1e9 + 5;
static constexpr ll infl = (ll)1e18 + 5;
static mt19937 rng((uint32_t)chrono::duration_cast<chrono::nanoseconds>(
                       chrono::high_resolution_clock::now().time_since_epoch())
                       .count());
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  int n;
  cin >> n;
  int s = sqrt(n);
  int start = n - s + 1, m = n;
  vi ans;
  while (((int)(ans).size()) < n) {
    for (int i = 0; i < (s); ++i) {
      if (((int)(ans).size()) == n) break;
      ans.push_back(start + i);
    }
    start -= s;
    start = max(start, 1);
  }
  for (auto& ai : ans) cout << ai << ' ';
  return 0;
}
