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 __future__ import division, print_function
import bisect
import math
import heapq
import itertools
import sys
from collections import deque
from atexit import register
from collections import Counter
from functools import reduce
sys.setrecursionlimit(100000)
if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream
 
 
if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
 
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)
 
        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)
 
        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)
 
    input = raw_input
    range = xrange
 
    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip
 
 
def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.
 
    Args:
        sync (bool, optional): The new synchronization setting.
 
    """
    global input, flush
 
    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        def input(): return sys.stdin.readline().rstrip('\r\n')
 
        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))
 
 
def dd():
    return map(int, input().split())
 
 
def arr():
    return list(map(int, input().split()))
 
 
def twinSort(X, Y):
    # sorting X wrt Y
    return [x for _, x in sorted(zip(Y, X))]

 
def solve():
    input()
    k,n,m=dd()
    ar=arr()
    br=arr()
    currentPages=k
    nIndex=0
    mIndex=0
    car=0
    ans=[]
    diffFlag=0
    puraBreak=0
    prevM=-1
    prevN=-1
    while (nIndex<n or mIndex<m) and puraBreak==0:
        # print(nIndex,mIndex)
        if car==0 and nIndex<n:
            while nIndex<n:
                # print(nIndex,mIndex,1)
                if ar[nIndex]==0:
                    currentPages+=1
                    ans.append(0)
                    nIndex+=1
                else:
                    if ar[nIndex]<=currentPages:
                        ans.append(ar[nIndex])
                        nIndex+=1
                    else:
                        car=1
                        diffFlag=1
                        break
        else:
            while mIndex<m:
                if br[mIndex]==0:
                    currentPages+=1
                    ans.append(0)
                    mIndex+=1
                    diffFlag=0
                else:
                    if br[mIndex]<=currentPages:
                        ans.append(br[mIndex])
                        mIndex+=1
                        diffFlag=0
                    else:
                        car=0
                        if diffFlag==1:
                            puraBreak=1
                        break
        if prevN==nIndex and prevM==mIndex:
            puraBreak=1
        prevN=nIndex
        prevM=mIndex
    if puraBreak==1:
        print(-1)
    else:
        print(*ans)




    
    


    
    
 
 
def main():
    testCase = 1
    if testCase:
        for _ in range(int(input())):
            solve()
    else:
        solve()
 
 
if __name__ == '__main__':
    sync_with_stdio(False)
    main()