function h(n,f,t,v)if n>0 then h(n-1,f,v,t)io.write(f)T=T..t h(n-1,v,t,f)end end T='\n'h(io.read'*n','A','C','B')print(T)