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, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat, permutations
import math
import heapq

MOD = 998244353
def inp(force_list=False):
    re = map(int, raw_input().split())
    if len(re) == 1 and not force_list:
        return re[0]
    return re

def inpf(force_list=False):
    re = map(float, raw_input().split())
    if len(re) == 1 and not force_list:
        return re[0]
    return re

def inst():
    return raw_input().strip()

def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def lcm(x, y):
    return x*y/(gcd(x,y))

def qmod(a, b, mod=MOD):
    res = 1
    while b:
        if b&1:
            res = (res*a)%mod
        b >>= 1
        a = (a*a)%mod
        # print b
    return res

def inv(a):
    return qmod(a, MOD-2)

def query(num, k):
    print tmk(num, k)
    stdout.flush()
    return inp()

def my_main():
    kase = inp()
    pans = []
    cur = []

    for _ in range(kase):
        inp()
        k, n, m = inp()
        da = inp(True)
        db = inp(True)
        ia, ib = 0, 0
        ans = []
        while ia < len(da) or ib < len(db):
            op = 0
            while ia < len(da) and da[ia] == 0:
                ans.append(0)
                ia += 1
                k += 1
                op = 1
            while ib < len(db) and db[ib] == 0:
                ans.append(0)
                ib += 1
                k += 1
                op = 1
            while ia < len(da) and 0< da[ia] <= k:
                ans.append(da[ia])
                ia += 1
                op = 1
            while ib < len(db) and 0< db[ib] <= k:
                ans.append(db[ib])
                ib += 1
                op = 1
            # print op, ans, ia, ib, k
            if op == 0:
                ans = [-1]
                break
        pans.append(' '.join(map(str, ans)))




    print '\n'.join(pans)


my_main()
