#include <iostream>
#include <queue>
#include <vector>
using namespace std;
int main() {
int n;cin>>n;
queue<int> a, b;
for(int i = 1;i <= n;++i){
if(i & 1) a.push(i);
else b.push(i);
}
vector<int> ans;
if(1){
int cnt = 1, tem = 0;
while(a.size() + b.size() > 0){
tem = cnt;
while(b.size() && tem){
ans.push_back(b.front());
// cout<<b.front()<<" ";
b.pop();
tem--;
}
cnt *= 2;
while(a.size() && tem){
ans.push_back(a.front());
// cout<<a.front()<<" ";
a.pop();
tem--;
}
cnt *= 2;
}
}else{
// int cnt = 1, tem = 0;
// while(a.size() + b.size() > 0){
// tem = cnt;
// while(a.size() && tem){
// ans.push_back(a.front());
// a.pop();
// tem--;
// }
// cnt *= 2;
// tem = cnt;
// while(b.size() && tem){
// ans.push_back(b.front());
// b.pop();
// tem--;
// }
// cnt *= 2;
// }
}
for(int i = 0;i < ans.size();++i){
cout<<ans[i];
if(i != ans.size() - 1) cout<<" ";
}
}
// 64 位输出请用 printf("%lld")