#include <bits/stdc++.h>
using namespace std;
unsigned loop_size;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int p = sqrt(n);
  int i = n - p + 1;
  int j = 0;
  while (i > 0) {
    while (j < p) {
      cout << i << " ";
      i++;
      j++;
    }
    i = i - 2 * p;
    j = 0;
  }
  for (int k = 1; k < i + p; k++) {
    cout << k << " ";
  }
  return 0;
}
