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