import java.util.Scanner;
public class hannuo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入要盘子的数目:");
Scanner in=new Scanner(System.in);
int s=in.nextInt();
move m1=new move();
m1.move3step(s, 'A', 'B', 'C');
}
}
class move
{
void move3step(int n,char one ,char two,char three)
{
if (n==1) move2step(one,three);
else
{
move3step(n-1,one,three,two);
move2step(one,three);
move3step(n-1,two,one,three);
}
}
void move2step(char x,char y)
{
System.out.println(x+"->"+y);
}
}