#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 10;
int main() {
  int n, j;
  cin >> n;
  int x = floor(sqrt(n));
  for (int i = n; i >= 1; i -= x) {
    for (j = (i - x + 1) > 0 ? i - x + 1 : 1; j <= i; j++) cout << j << " ";
  }
  return 0;
}
