#include <iostream.h>
using namespace std;
void move(int top,int n,char src,char dst,char tmp)
{
if(1==n)
cout << top << ":" << src << "-->" << dst << endl;
else
{
move(top,n-1,src,tmp,dst);
move(top+n-1,1,src,dst,tmp);
move(top,n-1,tmp,dst,src);
}
}
int main(void)
{
move(1,3,'A','B','C');
return 0;
}