for _ in range(int(input())): N = int(input()) time = (3 * N - 6) // 3 print('ABAC' + 'ABC' * time + 'BC')