#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1)
    cout << 1;
  else if (n == 2) {
    cout << "1 2";
  } else {
    int min_ans = INT_MAX;
    int min_lis = 1;
    for (int l = 1; l <= n; l++) {
      int ans = l + ceil((float)n / l);
      if (min_ans > ans) {
        min_ans = ans;
        min_lis = l;
      }
    }
    int num = max(n - min_lis + 1, 1);
    int lis = 0;
    for (int i = 1; i <= n; i++) {
      cout << num << " ";
      lis++;
      if (lis == min_lis) {
        lis = 0;
        num = max(1, num - 2 * min_lis + 1);
      } else {
        num++;
      }
    }
  }
}
