import java.util.Scanner;
public class CS {
private static int a[]=new int[3];
private static boolean used[]=new boolean[3];
public static void main(String args[]){
//输入1-n个数的全排列
sort(1);
}
public static void sort(int level){
for(int i=1;i<3;i++){
if(!used[i]){
a[level]=i;
used[i]=true;
/*
if(level!=2)
sort(level+1);
else{
for(int k=1;k<3;k++)
System.out.print(a[k]+" ");
System.out.println();}
used[i]=false;
*/
if(level!=2){
sort(level+1);}
else{
for(int k=1;k<3;k++)
System.out.print(a[k]+" ");
System.out.println();
}
used[i]=false;
}
}
}
}