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())):
    weojov = input()
    klist = [int(x) for x in input().split()]
    k = klist[0]
    n = klist[1]
    m = klist[2]
    a = 0
    b = 0


    mono = [int(x) for x in input().split()]
    poly = [int(x) for x in input().split()]
    ans = []

    for i in range(m + n  ):


        if a < n :
            if mono[a] <= k:
                if mono[a] == 0:
                    k += 1
                ans.append(str(mono[a]))
                a +=   1
                continue

            elif b < m :
                if poly[b] <= k:
                    if poly[b] == 0:
                        k += 1
                    ans.append(str(poly[b]))
                    b +=   1
                    continue

                else:
                    ans = ['-1']
                    break
            else:
                ans = ['-1']
                break



        elif b < m :
            if poly[b] <= k:
                if poly[b] == 0:
                    k += 1
                ans.append(str(poly[b]))
                b += 1
                continue

            else:
                ans = ["-1"]
                break
        else:
            ans = ["-1"]
            break

    print(" ".join(ans))
