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

def main():
    for _ in range(int(input())):
        input()
        k, n, m = map(int, input().split())
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))

        ai = 0
        bi = 0

        ansf = True
        ans = []

        while ai < n and bi < m:
            while ai < n and a[ai] == 0:
                ans.append(0)
                ai += 1
                k += 1

            while bi < m and b[bi] == 0:
                ans.append(0)
                bi += 1
                k += 1

            fa = (ai == n or a[ai] > k)
            fb = (bi == m or b[bi] > k)

            if fa and fb:
                ansf = False
                break

            if not fa:
                ans.append(a[ai])
                ai += 1

            if not fb:
                ans.append(b[bi])
                bi += 1

        for i in range(ai, n):
            if a[i] > k:
                anf = False
                break
            ans.append(a[i])

        for i in range(bi, m):
            if b[i] > k:
                anf = False
                break
            ans.append(b[i])

        if ansf:
            print(*ans)
        else:
            print(-1)






if __name__ == '__main__':
    main()