#include <bits/stdc++.h>
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int x = sqrt(n);
  int y = (n - 1) / x + 1;
  int cur = n + 1;
  int cnt = 1;
  for (int i = 1; i <= y; ++i) {
    cur = max(1, cur - x);
    int tmp = cur;
    while (cnt <= n) {
      cout << tmp << ' ';
      tmp++;
      cnt++;
      if (tmp == cur + x) {
        break;
      }
    }
  }
  return 0;
}
