t = int(input()) l=['A','B','C'] for _ in range(t): n = int(input()) moji='' for i in range(n): for j in range(3): moji+=l[(i+j)%3] print(moji)