#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e3 + 9;
int n;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  int part = sqrt(n);
  int pr = n;
  for (int i = n - part; i + part >= 0; i -= part) {
    int sta = max(i, 0);
    for (int j = sta; j < pr; j++) {
      cout << j + 1 << ' ';
    }
    pr = sta;
  }
  cout << '\n';
}
