for _ in range(int(input())):
    n, m = map(int, input().split())
    print((lambda a: ("a" * a + "b" * (n - a))) (max(int(input().split()[0]) for _ in range(m))))
153774f9e49122a3f985b40fc65a3263a21478fa
<mask token>

for _ in range(int(input())):
    n, m = map(int, input().split())
    print((lambda a: 'a' * a + 'b' * (n - a))(max(int(input().split()[0]) for
        _ in range(m))))

for _ in range(int(input())):
    n, m = map(int, input().split())
    print((lambda a: ("a" * a + "b" * (n - a))) (max(int(input().split()[0]) for _ in range(m))))