#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int N=20;
bool visited[N];
int n;
void dfs(int u)
{
if(u > n){
for(int i = 1; i <= n; i ++)
if(visited[i])
cout << i << " ";
cout << endl;
return;
}
else{
visited[u] = true;
dfs(u + 1);
visited[u] = false;
dfs(u + 1);
}
}
int main(){
cin >> n;
dfs(1);
return 0;
}