#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = sqrt(n);
  if (n % t == 0) {
    int h = n / t;
    for (int i = 1; i <= h; ++i) {
      for (int j = n - t + 1; j <= n; ++j) cout << j << " ";
      n = n - t;
    }
    cout << '\n';
  } else {
    int h = n / t;
    int resst = n % t;
    ++t;
    for (int i = 1; i <= resst; ++i) {
      for (int j = n - t + 1; j <= n; ++j) cout << j << " ";
      n = n - t;
    }
    --t;
    for (int i = resst + 1; i <= h; ++i) {
      for (int j = n - t + 1; j <= n; ++j) cout << j << " ";
      n = n - t;
    }
    cout << '\n';
  }
}
