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())):
    input()
    k, n, m = map(int, input().split())
    a1 = list(map(int, input().split()))
    a2 = list(map(int, input().split()))
    l, r = 0, 0
    ans = []
    count = k
    flag=0
    while l < n or r < m:
        f1, f2 = 0, 0
        if l < n:
            if a1[l] > count:
                f1 = 1
                pass
            else:
                if a1[l] == 0:
                    count += 1
                ans.append(a1[l])
                l += 1
        if r < m:
            if a2[r] > count:
                f2 = 1
                pass
            else:
                if a2[r] == 0:
                    count += 1
                ans.append(a2[r])
                r += 1
        if (f1 and f2) or (f1 and r==m) or (f2 and l==n):
            flag = 1
            ans = -1
            break
    if flag:
        print(ans)
    else:
        for i in range(m + n):
            print(ans[i], end=" ")
        print()