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

from sys import stdin


def A():
    t = int(stdin.readline())

    while t:
        aaa= stdin.readline()
        t -= 1
        d = [int(x) for x in stdin.readline().split()]
        xa, ya = d[0], d[1]
        c = [int(x) for x in stdin.readline().split()]
        xb, yb = c[0], c[1]
        b = [int(x) for x in stdin.readline().split()]
        xf, yf = b[0], b[1]
        sava = abs(xa - xb)
        savb = abs(ya - yb)
        res  = sava + savb
        if xa == xb == xf:
            if ya < yf < yb:
                res += 2
            elif yb < yf < ya:
                res += 2

        elif ya == yb == yf:
            if xa < xf < xb:
                res += 2
            elif xb < xf < xa:
                res += 2
        elif xa == ya and xb == yb and xf == yf:
            if xa < xf < xb:
                res += 0
            elif xb < xf < xa:
                res += 0
            else:
                res = sava
        print(res)
def B():
    t = int(stdin.readline())

    while t:
        s = input()
        t-= 1
        s1 = []
        for i in s:
            s1.append(ord(i) - ord('a'))
        sav = max(s1)
        l = 0
        r1 = len(s1) - 1
        res = True
        k = [0] * 30
        for i in s1:
            if k[i] > 1:
                res = False
                break
            k[i] += 1
        for i in k:
            if i > 1:
                res = False
                break
        if len(s1) > 1 and res:
            while sav == s1[l] or sav == s1[r1]:
                if sav == s1[l] == s1[r1]:
                    res = False
                    break
                if sav == s1[l]:
                    l += 1
                elif sav == s1[r1]:
                    r1 -= 1
                else:
                    res = False
                    break
                sav -= 1
                if sav <= 0 or l >= r1:
                    break
        if sav <= 0 and res:
            print("YES")
        else:
            print("NO")

def C():
    t = int(stdin.readline())

    while t:
        aaa = stdin.readline()
        t -= 1
        d = [int(x) for x in stdin.readline().split()]
        k,n,m = d[0], d[1], d[2]
        a = [int(x) for x in stdin.readline().split()]
        b = [int(x) for x in stdin.readline().split()]
        res = []
        sav = True
        if abs(m-n) > 1:
            sav = False
        for i in range(0, min(n,m)):
            if a[i] != 0 and b[i] != 0:
                sav = False
                break
            if a[i] == 0:
                res.append(a[i])
                res.append(b[i])
            else:
                res.append(b[i])
                res.append(a[i])
        for i in range(min(n,m), max(n,m)):
            if n == max(n,m):
                res.append(a[i])
            else:
                res.append(b[i])
        if sav == False:
            print(-1)
        else:
            for i in res:
                print(i, end=" ")
            print()

C()