#include<bits/stdc++.h> //递归搜索树 tree 1234四个数 每个树为一层选还是不选伸枝
using namespace std;
const int N=20;
int n;
bool st[N]; //u记录了升序数字走到了第几个 st记录了此位的数字是否被选用
void dfs(int u ){
//开头边界判定
if(u>n){
for(int i =1;i<=n;i++)
if(st[i]) printf("%d ",i);
cout<<endl;
return; //递归出口 到达最下层后输出并返回上层
}
st[u]=true;
dfs(u+1);
st[u]=false;
dfs(u+1);
}
int main(){
cin>>n;
dfs(1);
return 0;
}