5

3 2 2
2 0
0 5

4 3 2
2 0 5
0 6

0 2 2
1 0
2 3

5 4 4
6 0 8 0
0 7 0 9

5 4 1
8 7 8 0
0

0 2 0 5
0 2 0 5 6
-1
0 6 0 7 0 8 0 9
-1

t = int(input())
for i in range(t):
    a = input()
    k, n, m = [int(i) for i in input().split()]
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    now = k
    i=0
    j=0
    ans = []
    while i<n or j<m:
        if i!=n:
            if a[i]==0:
                k+=1
                ans.append(0)
                i+=1
                continue
            elif k>=a[i]:
               ans.append(a[i])
               i+=1
               continue
        if j!=m:
            if b[j]==0:
                k+=1
                ans.append(0)
                j+=1
                continue
            elif k>=b[j]:
                ans.append(b[j])
                j+=1
                continue
        break
    if len(ans)< n+m:
        print(-1)
    else:
        for i in range(n+m):
            print(ans[i], end =' ')
        print()
