#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  int index = 0;
  long long int A[n];
  long long int cur = n;
  long long int L = sqrt(n);
  cur = cur - L + 1;
  for (int i = 0; i < n; i += L) {
    if ((i + L) >= n) break;
    long long int in = cur;
    long long int ch = 1;
    while ((ch <= L) && index < n) {
      A[index] = in;
      in++;
      ch++;
      index++;
    }
    cur = cur - L;
  }
  int nx = 1;
  while (index < n) {
    A[index] = nx;
    index++;
    nx++;
  }
  for (int i = 0; i < n; ++i) {
    cout << A[i] << " ";
  }
}
