#include <bits/stdc++.h>
using namespace std;
inline void proc_status() {
  ifstream t("/proc/self/status");
  cerr << string(istreambuf_iterator<char>(t), istreambuf_iterator<char>())
       << endl;
}
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline T read() {
  register T sum(0), fg(1);
  register char ch(getchar());
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') fg = -1;
  for (; isdigit(ch); ch = getchar()) sum = sum * 10 + ch - '0';
  return sum * fg;
}
const int MAXN = (int)2e5;
int n;
inline void input() { n = read<int>(); }
int p[MAXN + 5];
inline void solve() {
  int ans = n + 1, ans_id = 1;
  for (int i = 1; i <= n; ++i)
    if (chkmin(ans, (n + i - 1) / i + i)) ans_id = i;
  memset(p, 0, sizeof p);
  int lst = n;
  for (int i = 1; i + ans_id - 1 <= n; i += ans_id)
    for (int j = i + ans_id - 1; j >= i; --j) p[j] = lst, --lst;
  for (int i = n; i; --i)
    if (!p[i]) p[i] = lst, --lst;
  for (int i = 1; i <= n; ++i) printf("%d ", p[i]);
  puts("");
}
int main() {
  input();
  solve();
  return 0;
}
