import java.util.*;
public class Main{
static int N=16;
static int[] st = new int[N];// 表示状态 0 未选择 1为已选 2为不选
static int n=0;
public static void main(String[] args)throws Exception{
Scanner in = new Scanner(System.in);
n = in.nextInt();
dfs(1);
}
public static void dfs(int m){
if(m>n){
for(int i=1;i<=n;i++){
if(st[i]==1){
System.out.print(i+" ");
}
}
System.out.println("");
return;
}
st[m]=2;
dfs(m+1);
//st[m]=0; 恢复父节点状态
st[m]=1;
dfs(m+1);
st[m]=0;
}
}
06-29
584