#include <bits/stdc++.h>
using namespace std;
int n;
int ans[100000 + 1];
void reverseAns(int l, int r) {
  if (l > r) return;
  int mid = (l + r) >> 1;
  for (int i = 1; i <= mid - l + 1; ++i) {
    swap(ans[i + l - 1], ans[r - i + 1]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    ans[i] = i;
  }
  int block = round(sqrt(n));
  int tot = n / block;
  for (int i = 1; i <= tot; ++i) {
    reverseAns((i - 1) * block + 1, i * block);
  }
  reverseAns(tot * block + 1, n);
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
