#include <iostream>
using namespace std;
int n;
void dfs(int t, int state){
if(t >= n){
for(int i = 0; i < n; i ++ ){
if((state >> i) & 1) cout << i + 1 << " ";
}
cout << endl;
return ;
}
dfs(t + 1, state);
dfs(t + 1, state | (1 << t));
}
int main(){
cin >> n;
dfs(0, 0);
return 0;
}