I am getting NZEC error and exit code 1

please anyone could help me with the error

t = int(input())

a = []

while t > 0:

t-=1

n = int(input())

for i in range(n):

b = list(map(str,input().split()))

a = a + b

```
for i in range(0,len(a),2):
flag = 0
for j in range(0,len(a),2):
if i != j:
if a[i] == a[j]:
flag = 1
break
else:
flag = 0
if flag == 1:
print(a[i],a[i+1])
else:
print(a[i])
```