import java.util.*;
class Main{
static int n;
static int st[]=new int [16];
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
n=in.nextInt();
dfs(1);
}
//wei kao lv 1 xuan 2buxuan
static void dfs(int u) {
if(u>n) {
for(int i=1;i<=n;i++) {
if(st[i]==1) {
System.out.print(i+” “);
}
}
System.out.println();
return;
}
st[u]=2;//bu xuan
dfs(u+1);
st[u]=0;
st[u]=1;
dfs(u+1);
st[u]=0;
}
}