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 collections import Counter
import string
import math
import bisect
#import random
import sys
# sys.setrecursionlimit(10**6) 
from fractions import Fraction
def array_int():
    return [int(i) for i in sys.stdin.readline().split()]
def vary(arrber_of_variables):
    if arrber_of_variables==1:
        return int(sys.stdin.readline())
    if arrber_of_variables>=2:
        return map(int,sys.stdin.readline().split()) 
def makedict(var):
    return dict(Counter(var))
testcases=vary(1)
for _ in range(testcases):
    input()
    k,n,m=vary(3)
    a=array_int()
    b=array_int()
    st=[]
    for i in range(min(n,m)):
        if a[i]==0:
            st.append(a[i])
            k+=1
        if b[i]==0:
            st.append(b[i])
            k+=1
        if a[i]!=0 and b[i]==0:
            st.append(a[i])
            if a[i]>k:
                print(-1)
                break
        elif b[i]!=0 and a[i]==0:
            st.append(b[i])
            if b[i]>k:
                print(-1)
                break
        else:
            if a[i]==b[i] and b[i]==0:
                continue
            if max(a[i],b[i])>k:
                print(-1)
                break
            st.extend((a[i],b[i]))
    else:
        if n==m:
            print(*st)
            continue
        if n>m:
            for i in range(min(n,m),max(n,m)):
                if a[i]==0:
                    k+=1
                    st.append(a[i])
                else:
                    if a[i]>k:
                        print(-1)
                        break
                    st.append(a[i])
            else:
                print(*st)
        else:
            for i in range(min(n,m),max(n,m)):
                if b[i]==0:
                    k+=1
                    st.append(b[i])
                else:
                    if b[i]>k:
                        print(-1)
                        break
                    st.append(b[i])
            else:
                print(*st)