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

# cook your dish here
t = int(input())
for _ in range(t):
    x = input()
    k,n,m = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    ans = [0 for i in range(k)]
    i = j = 0
    flag = 1 
    arr = []
    while i < n and j < m:
        try:
            # print(ans)
            if a[i] <= b[j]:
                arr.append(a[i])
                if a[i] == 0:
                    ans.append(0)
                else:
                    ans[a[i]-1] = a[i]
                i += 1
            else:
                arr.append(b[j])
                if b[j] == 0:
                    ans.append(0)
                else:
                    ans[b[j]-1] = b[j]
                j += 1
        except:
            flag = 0
            break
    while i < n:
        try:
            # print(ans)
            # if a[i] <= b[j]:
                arr.append(a[i])
                if a[i] == 0:
                    ans.append(0)
                else:
                    ans[a[i]-1] = a[i]
                i += 1
        except:
            flag = 0
            break
    while j < m:
        try:
            # print(ans)
            # if a[i] > b[j]:
                arr.append(b[j])
                if b[j] == 0:
                    ans.append(0)
                else:
                    ans[b[j]-1] = b[j]
                j += 1
        except:
            flag = 0
            break
    if flag:
        print(*arr)
    else:
        print(-1)
        
            
            
    
        
        