#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 69, base = 1024 * 1024, mod = 1e9 + 7;
int32_t main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int sq = sqrt(n);
  while (n > sq) {
    n -= sq;
    for (int i = 1; i <= sq; i++) cout << n + i << " ";
  }
  for (int i = 1; i <= n; i++) cout << i << " ";
}
