include<iostream>
#include<vector>
using namespace std;
int n;
vector<int> chosen;
void C(int x){
if(x==n+1){
for(int i=0;i<chosen.size();i++) printf("%d ",chosen[i]);
printf("\n");
return;
}
//printf("into unchoose %d\n",x+1);
C(x+1);
//printf("int choose %d\n",x+1);
chosen.push_back(x);
C(x+1);
chosen.pop_back();
//printf("%d,over\n",x);
return;
}
int main(){
scanf("%d",&n);
C(1);
return 0;
}