#include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> choose;
void calc(int x){
if(x== n + 1)
{
for(int i = 0; i < choose.size(); i++)
printf("%d ",choose[i]);
puts("");
return ; //如果在边界时不return释放资源,会一直等待出不去
}
//不选x
calc(x + 1);
//选
choose.push_back(x);
calc(x + 1);
//还原现场
choose.pop_back();
}
int main()
{
cin>>n;
calc(1);
return 0;
}