#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mini = n * 3;
  int optLIS = n;
  int currLIS = n;
  while (currLIS > 0) {
    if (currLIS + (n / currLIS) + (n % currLIS == 0 ? 0 : 1) < mini) {
      mini = currLIS + (n / currLIS) + (n % currLIS == 0 ? 0 : 1);
      optLIS = currLIS;
    }
    currLIS--;
  }
  stack<int> total{};
  int cnt = 0;
  while (cnt <= n) {
    vector<int> temp(0);
    for (int i = 1; i <= optLIS; i++) {
      cnt++;
      if (cnt > n) break;
      temp.push_back(cnt);
    }
    reverse(temp.begin(), temp.end());
    for (int i : temp) total.push(i);
  }
  for (int i = 0; i < (n); i++) {
    int in;
    in = total.top();
    total.pop();
    printf("%d ", in);
  }
}
