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

#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase
def I():return (int(input()))
def In():return(map(int,input().split()))
def ln():return list(map(int,input().split()))
def Sn():return input().strip()
BUFSIZE = 8192
#complete the main function with number of test cases to complete greater than x
def find_gt(a, x):
    i = bi.bisect_left(a, x)
    if i != len(a):
        return i
    else:            
        return len(a)

def solve():
    s=Sn()
    k,n,m=In()
    a=list(In())
    b=list(In())
    ans=[]
    i,j=0,0
    ok=True
    op=k
    for p in range(n+m):
        if i<n and j<m:
            t1,t2=False ,False
            if a[i]==0:
                ans.append(0)
                op+=1
                i+=1
                continue
            if b[j]==0:
                ans.append(0)
                op+=1
                j+=1
                continue

            if t1==False and a[i]!=0 :
                if op<a[i]:
                    if b[j]!=0 and b[j]>op:
                        ok=False

                        break
                    elif b[j]<=op:
                        ans.append(b[j])
                        j+=1
                        continue
                else:
                    ans.append(a[i])
                i+=1
                continue
            if  t2==False and b[j]!=0 :
                if op<b[j]:
                    ok=False
                    break
                else:
                    ans.append(b[j])
                j+=1
                continue
        elif i<n:
            if a[i]==0:
                op+=1
                i+=1
                ans.append(0)
            else:
                if op<a[i]:
                    ok=False

                    break
                else:
                    ans.append(a[i])
                    i+=1
        elif j<m :
            if b[j]==0:
                op+=1
                j+=1
                ans.append(0)
            else:
                if op<b[j]:
                    ok=False
                    break
                else:
                    ans.append(b[j])
                    j+=1

    if ok:
        print(*ans)
    else:
        print(-1)
                
                        
    pass



def main():
    T=I()
    for i in range(T):
        solve()

import __pypy__


def main():
    pass


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()