#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = sqrt(n);
  for (int i = n + 1; i > 0; i -= s) {
    for (int j = max(i - s, 1); j < i; j++) cout << j << " ";
  }
}
