#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
const int N = 16;
int n;
int st[N];//是否选择,1 选,2 不选
void dfs(int u)//递归
{
if (u > n) {
for (int i = 1;i <= n;i++) {
if (st[i] == 1)cout << i << " ";
}
cout << endl;
return;
}
st[u] = 1;//选
dfs(u+1);//递归
st[u] = 0;//恢复现场
st[u] = 2;
dfs(u+1);
st[u] = 0;
}
int main()
{
cin >> n;
dfs(1);
return 0;
}