import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline sys.set_int_max_str_digits(0) from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd, lcm, factorial, perm, comb from itertools import product, permutations, combinations from functools import lru_cache #@lru_cache(maxsize=128) #重複あり:list(product(list('123'),repeat = 2)),重複なし:list(permutations(list('123'))) MOD = 998244353 t = int(input()) for _ in range(t): n = int(input()) a = deque() b = deque() c = deque() for _ in range(n): a.append('A') b.append('B') c.append('C') ok=0 aok=1 ans='' for i in range(n): for j in range(3): if a: ans+=a.pop() if not ok: ans+=b.pop() ok=1 else: ans+=c.pop() ok=0 else: break if ok: while c and b: ans+=c.pop() ans+=b.pop() else: while c and b: ans+=b.pop() ans+=c.pop() if b: ans+=b.pop() if c: ans+=c.pop() print(ans)