#include<iostream> #include<cstdio> using namespace std; void hanor(int src,int mid,int desk,int count){ if(count==1){ printf("%c -> %c ",src,desk); return; } hanor(src,desk,mid,count-1); printf("%c %c ",src,mid); hanor(mid,src,desk,count-1); } int main() { int n; scanf("%d",&n); hanor('a','b','c',n); return 0; }