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

for _ in range(int(input())):
    space = input()
    k, n, m = map(int, input().split())
    
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    
    output = []
    
    sol = [0] * k
    
    i = 0
    j = 0
    
    check = True
    
    while(check and i < len(a) and j < len(b)):
        if (a[i] == 0):
            sol.append(0)
            output.append('0')
            i += 1
        elif (b[j] == 0):
            sol.append(0)
            output.append('0')
            j += 1
        elif (a[i] <= len(sol)):
            output.append(str(a[i]))
            i += 1
        elif (b[j] <= len(sol)):
            output.append(str(b[j]))
            j += 1
        else:
            check = False
            break
        
    while(check and i < len(a)):
        if (a[i] == 0):
            sol.append(0)
            output.append('0')
            i += 1
        elif (a[i] <= len(sol)):
            output.append(str(a[i]))
            i += 1
        else:
            check = False
            break
        
    while(check and j < len(b)):
        if (b[j] == 0):
            sol.append(0)
            output.append('0')
            j += 1
        elif (b[j] <= len(sol)):
            output.append(str(b[j]))
            j += 1
        else:
            check = False
            break
        

    if check:
        print(' '.join(output))
    else:
        print(-1)
            
    
    