#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  if (n == 2) {
    cout << 1 << " " << 2;
    return 0;
  }
  if (n == 3) {
    cout << 1 << " " << 3 << " " << 2;
    return 0;
  }
  long long int x = sqrt(n);
  long long int y = x;
  long long int m = n;
  if (x * x < n) {
    long long int i = 0;
    while (x * y < n) {
      if (i % 2 == 0)
        x++;
      else
        y++;
      i++;
    }
  }
  for (long long int i = 0; i < y; i++) {
    for (long long int j = x - 1; j >= 0; j--) {
      if (m - j > 0) cout << m - j << " ";
    }
    m -= x;
  }
  return 0;
}
