#include<bits/stdc++.h>
using namespace std;
struct compare{
bool operator()(int a,int b){
return a>b;
}
};
int main()
{
freopen("minvalinset.in","r",stdin);
freopen("minvalinset.out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
int n,x=1,y=1,z=1;
cin>>n;
priority_queue<long long, vector<long long>,compare> q;
unordered_set<long long> vis;
q.push(1);
vis.insert(1);
for (int i = 0; i < n; i++) {
long long now = q.top();
q.pop();
cout << now << " ";
long long y = 2 * now + 1;
long long z = 3 * now + 1;
if (!vis.count(y)) {
vis.insert(y);
q.push(y);
}
if (!vis.count(z)) {
vis.insert(z);
q.push(z);
}
}
return 0;
}