problem
solution
codes
#include<iostream>
using namespace std;
int n, ans = 0, t;
void f(int a, char b, char c){
ans++;
if(a == 1){
if(t)cout<<a<<" from "<<b<<" to "<<c<<"
";
return ;
}
f(a-1,b,198-b-c);
if(t)cout<<a<<" from "<<b<<" to "<<c<<"
";
f(a-1,198-b-c,c);
}
int main(){
cin>>n;
f(n,'A','C');
cout<<ans<<"
";
t = 1;
f(n,'A','C');
return 0;
}