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