#include <bits/stdc++.h>
#define int long long 
using namespace std;
vector<vector<int> > v;
int32_t main() {
    int n;cin>>n;
    int k = sqrt(n);
    if(k*k<n)k++;
    vector<int> tmp;
    for(int i = 1;i<=n;i++) {
        tmp.push_back(i);
        if(i%k==0){
            v.push_back(tmp);
            tmp.clear();
        }
    }
    if(tmp.size()){
    v.push_back(tmp);
    tmp.clear();}
    reverse(v.begin(),v.end());
    for(auto vec : v){
        for(auto e : vec)cout<<e<<" ";
    }
}