import java.util.Scanner;
public class Main {
static int N=20;
static int n;
static int[] st=new int[N];
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
n=in.nextInt();
dfs(1);
}
static void dfs(int u){
if(u==n+1){
for(int i=1;i<=n;i++){
if(st[i]==1){
System.out.print(i+" ");
}
}
System.out.println();
return;
}
st[u]=2;
dfs(u+1);
st[u]=0;
st[u]=1;
dfs(u+1);
st[u]=0;
}
}