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 _ in range(t):
    input()
    k, n, m = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    seq = []
    ns = 0
    ms = 0
    while(ns != n or ms != m):
        temp = 0
        while(ns < n and (a[ns] == 0 or a[ns] <= k)):
            temp = 1
            if(a[ns] == 0):
                k += 1
            seq.append(a[ns])
            ns += 1
        while(ms < m and (b[ms] == 0 or b[ms] <= k)):
            temp = 1
            if(b[ms] == 0):
                k += 1
            seq.append(b[ms])
            ms += 1
        if(temp == 0):
            break 
    if(len(seq) == m+n):
        print(*seq)
    else:
        print(-1)
