#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const int MAX = 2e9 + 7;
const long long MOD = 1e9 + 7;
void solve(int qq) {
  int n;
  cin >> n;
  int l;
  int r;
  int mn = 2e9;
  for (int i = 1; i <= n; i++) {
    if (n % i == 0) {
      if (n / i + i <= mn) {
        l = i;
        r = n / i;
        mn = l + r;
      }
    } else if ((n + i - n % i) / i + i <= mn) {
      l = i;
      r = (n + i - n % i) / i;
      mn = l + r;
    }
  }
  l = max(l, r);
  for (int i = n; i >= 1; i -= l) {
    for (int j = max(i - l + 1, 1); j <= i; j++) {
      printf("%d ", j);
    }
  }
  cout << endl;
}
int main() {
  int t;
  t = 1;
  for (int i = 0; i < t; i++) {
    solve(i);
  }
  return 0;
}
