n = int(input())
for i in range(0, n):
    m, l = map(int, input().split(" "))
    print(m)
    for j in range(0, l):
        print(input())
a24e555efee400244730a83cad7628c41ce54229
<mask token>

<mask token>
for i in range(0, n):
    m, l = map(int, input().split(' '))
    print(m)
    for j in range(0, l):
        print(input())

n = int(input())
for i in range(0, n):
    m, l = map(int, input().split(' '))
    print(m)
    for j in range(0, l):
        print(input())

n = int(input())
for i in range(0, n):
    m, l = map(int, input().split(" "))
    print(m)
    for j in range(0, l):
        print(input())