#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int maxn = 15;
int m;
int a[maxn];//存放数字状态 0 未考虑, 1选 2不选
void pit (int n){
if(n == m){
for(int i = 0; i < maxn; i++)
if(a[i] == 1) printf("%d ", i + 1);
printf("\n");
return;
}
a[n] = 2;
pit(n + 1);
a[n] = 0;
a[n] = 1;
pit(n + 1);
}
int main()
{
cin >> m;
pit(0);
return 0;
}