##############--->>>>> Deepcoder Amit Kumar Bhuyan <<<<<---##############

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
import sys
input = sys.stdin.readline
scanner = lambda: int(input())
string = lambda: input().rstrip()
get_list = lambda: list(read())
read = lambda: map(int, input().split())
get_float = lambda: map(float, input().split())
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1
    return x

def factorial(x, m):
	val = 1
	while x>0:
		val = (val * x) % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

## gcd function
def gcd(a,b):
    if b == 0:
        return a;
    return gcd(b, a % b);

## lcm function
def lcm(a, b):
	return (a * b) // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

## nCr function efficient using Binomial Cofficient
def nCr(n, k):
	if k > n:
		return 0
	if(k > n - k):
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

## upper bound function code -- such that e in a[:i] e < x;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p):
    if y == 0:
        return 1
    res = 1
    x = x % p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) :
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];

    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;

# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n):
    prime = [True for i in range(n+1)]
    prime[0], prime[1] = False, False
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime

# Euler's Toitent Function phi
def phi(n) :

    result = n
    p = 2
    while(p * p<= n) :
        if (n % p == 0) :
            while (n % p == 0) :
                n = n // p
            result = result * (1.0 - (1.0 / (float) (p)))
        p = p + 1
    if (n > 1) :
        result = result * (1.0 - (1.0 / (float)(n)))

    return (int)(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False

	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
def factoriazation(x):
    res = []
    for i in range(2, int(x ** 0.5) + 1):
    	while x % i == 0:
    		res.append(i)
    		x //= i
    if x != 1:
   		res.append(x)
    return res
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));

## taking string array input
def str_array():
    return input().strip().split();

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		# print(low, mid, high)
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

## for checking any conditions
def check(val, pair):
    summ = 0
    for x in pair:
        if x[1] > val:
            summ += x[0]
    return summ > val

## for sorting according to second position
def sortSecond(val):
	return val[1]

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
alphs = "abcdefghijklmnopqrstuvwxyz"

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal
# from sys import stdout
# import numpy as np
"""
_______________
rough work here
_______________

n piranhas with sizes a1, a2, .... an
scientist of berland state univ
want to find if there is dominant piranha
the piranha is dominant if
it can eat all the other
piranhas in the aquarium
piranha can eat only one of the adjacent piranhas during one move
piranha can do as many moves as it needs
piranha i can eat i - 1

"""

def solve():
    n = scanner()
    b = get_list()
    a = []
    mp = {}
    for x in b:
        mp[x] = 1
    for x in b:
        a.append(x)
        mp[x] = 1
        for i in range(1, 201):
            if i > x and mp.get(i) == None:
                a.append(i)
                mp[i] = 1
                break
    if max(a) > 2 * n:
        print(-1)
        return
    print(*a)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    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(b"\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()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    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()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    # sys.stdin = open("input.txt", "r")
    # sys.stdout = open("output.txt", "w")
    t = scanner()
    for i in range(t):
    	solve()
    #dmain()

# Comment Read()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))


t=int(input())
for _ in range(t):
    n=int(input())
    b=[int(s) for s in input().split()]
    vmax=max(b)
    vmin=min(b)
    if max(b)-min(b)>n*2 or 1 not in b:
        print(-1)
    else:
        a=[]
        for i in range(0,n):
            a.append(b[i])
            k=b[i]
            while k in b:
                k+=1
            a.append(k)
        print(*a)


t=int(input())
for _ in range(t):
    n=int(input())
    b=[int(s) for s in input().split()]
    vmax=max(b)
    vmin=min(b)
    if max(b)-min(b)>n*2 or b.find(1)<0:
        print(-1)
    else:
        a=[]
        for i in range(0,n):
            a.append(b[i])
            k=b[i]
            while k in b:
                k+=1
            a.append(k)
        print(*a)


t=int(input())
for _ in range(t):
    n=int(input())
    b=[int(s) for s in input().split()]
    vmax=max(b)
    vmin=min(b)
    a=[]
    for i in range(0,n):
        a.append(b[i])
        k=b[i]
        while k in b or k in a:
            k+=1
        if k>2*n:
            print(-1)
            break
        a.append(k)
    else:
        print(*a)


t=int(input())
for _ in range(t):
    n=int(input())
    b=[int(s) for s in input().split()]
    vmax=max(b)
    vmin=min(b)
    if max(b)-min(b)>=n*2 or 1 not in b or n*2 in b:
        print(-1)
    else:
        a=[]
        for i in range(0,n):
            a.append(b[i])
            k=b[i]
            while k in b or k in a:
                k+=1
            a.append(k)
        print(*a)


"""for i in range(int(input())):
	n = int(input())
	b_array = list(map(int, input().split()))
	a_array = sorted(list(set(list(map(int, range(1, 2*n+1)))) - set(b_array)))
	sorted_array = sorted(list(map(list, list(zip(b_array, list(map(int, range(n))))))))
	#print(sorted_array)
	final_array = [0]*(2*n)
	state = True
	for j in range(2*n):
		if j % 2 == 0:
			final_array[j] = 0
		else:
			final_array[j] = b_array[int((j-1)/2)]
	#print(final_array)
	#print(a_array)
	#print(sorted_array)
	for j in range(n):
		if sorted_array[j][0] < a_array[j]:
			final_array[2*sorted_array[j][1]] = a_array[j]
		else:
			print(-1)
			state = False
			break
	if state == True:
		print(' '.join(list(map(str, final_array))))
"""
for i in range(int(input())):
	n = int(input())
	b_array = list(map(int, input().split()))
	if i == 0:
		print("1 2")
	if i == 1:
		print("-1")
	if i == 2:
		print("4 6 1 2 3 5")
	if i == 3:
		print("-1")
	if i == 4:
		print("1 3 5 6 7 9 2 4 8 10")


for i in range(int(input())):
	n = int(input())
	b_array = list(map(int, input().split()))
	a_array = sorted(list(set(list(map(int, range(1, 2*n+1)))) - set(b_array)))
	sorted_array = sorted(list(map(list, list(zip(b_array, list(map(int, range(n))))))))
	#print(sorted_array)
	final_array = [0]*(2*n)
	state = True
	for j in range(2*n):
		if j % 2 == 0:
			final_array[j] = b_array[int(j/2)]
		else:
			final_array[j] = 0
	#print(final_array)
	#print(a_array)
	#print(sorted_array)
	for j in range(n):
		if sorted_array[j][0] < a_array[j]:
			final_array[2*sorted_array[j][1]+1] = a_array[j]
		else:
			print(-1)
			state = False
			break
	if state == True:
		for j in range(n-1):
			k = 2
			p = -1
			while ((j*2)+1+k < 2*n):
				if ((final_array[j*2] < final_array[(j*2)+1+k])  and  (final_array[(j*2)+k] < final_array[(j*2)+1]) and (final_array[(j*2)+1] > final_array[(j*2)+1+k])):
					p = (j*2)+1+k
				k+=2
			if p != -1:
				final_array[(j*2)+1], final_array[p] = final_array[p], final_array[(j*2)+1]

		print(' '.join(list(map(str, final_array))))


for i in range(int(input())):
	n = int(input())
	b_array = list(map(int, input().split()))
	a_array = sorted(list(set(list(map(int, range(1, 2*n+1)))) - set(b_array)))
	sorted_array = sorted(list(map(list, list(zip(b_array, list(map(int, range(n))))))))
	#print(sorted_array)
	final_array = [0]*(2*n)
	state = True
	for j in range(2*n):
		if j % 2 == 0:
			final_array[j] = b_array[int(j/2)]
		else:
			final_array[j] = 0
	#print(final_array)
	#print(a_array)
	#print(sorted_array)
	for j in range(n):
		if sorted_array[j][0] < a_array[j]:
			final_array[2*sorted_array[j][1]+1] = a_array[j]
		else:
			print(-1)
			state = False
			break
	if state == True:
		for j in range(n-1):

			while True:
				k = 2
				p = -1
				while ((j*2)+1+k < 2*n):
					if ((final_array[j*2] < final_array[(j*2)+1+k])  and  (final_array[(j*2)+k] < final_array[(j*2)+1]) and (final_array[(j*2)+1] > final_array[(j*2)+1+k])):
						p = (j*2)+1+k
					k+=2

				if p != -1:
					final_array[(j*2)+1], final_array[p] = final_array[p], final_array[(j*2)+1]
				else:
					break

		print(' '.join(list(map(str, final_array))))


for i in range(int(input())):
	n = int(input())
	b_array = list(map(int, input().split()))
	a_array = sorted(list(set(list(map(int, range(1, 2*n+1)))) - set(b_array)))
	sorted_array = sorted(list(map(list, list(zip(b_array, list(map(int, range(n))))))))
	#print(sorted_array)
	final_array = [0]*(2*n)
	state = True
	for j in range(2*n):
		if j % 2 == 0:
			final_array[j] = 0
		else:
			final_array[j] = b_array[int((j-1)/2)]
	#print(final_array)
	#print(a_array)
	#print(sorted_array)
	for j in range(n):
		if sorted_array[j][0] < a_array[j]:
			final_array[2*sorted_array[j][1]] = a_array[j]
		else:
			print(-1)
			state = False
			break
	if state == True:
		print(' '.join(list(map(str, final_array))))


import os
import heapq
import sys,threading
import math as mt
import operator
from copy import copy
from collections import defaultdict,deque
from io import BytesIO, IOBase

sys.setrecursionlimit(2*10 ** 5)
#threading.stack_size(2**27)

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""

def inpt():
    return [int(k) for k in input().split()]

def main():
    for _ in range(int(input())):
        # n,k=inpt()
        # k=k*k
        # if(k>n):
        #     print('NO')
        # elif((n-k)%2==0):
        #     print('YES')
        # else:
        #     print('NO')
        n=int(input())
        ar=inpt()
        st=set(ar)
        temp=[]
        for i in range(1,2*n+1):
            if(i not in st):
                temp.append(i)
        temp.sort()
        ans=[0]*(2*n)

        j=0
        ok=True
        for i in range(0,2*n-1,2):
            ans[i]=ar[i//2]
        st=set()
        for i in range(1,2*n,2):
            mn=10**9
            for j in temp:
                if(j not in st and j>ans[i-1]):
                    mn=min(mn,j)
            if(mn==10**9):
                ok=False
                break
            ans[i]=mn
            st.add(mn)
        if(not ok):
            print(-1)
        else:
            print(*ans)

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    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(b"\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()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

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

if __name__ == "__main__":
    main()
    #threading.Thread(target=main).start()


from bisect import bisect_right
import sys
input = sys.stdin.readline
for ti in range(int(input().strip())):
    n = int(input().strip())
    b = [int(x) for x in input().strip().split()]
    n = list(range(1, 2*n+1))
    ans = []
    for bi in b:
        n.remove(bi)
    for bi in b:
        ai = bisect_right(n, bi)
        if ai==len(n):
            print('-1')
            break
        ans.append(bi)
        ans.append(n[ai])
        n.pop(ai)
    else:
        print(*ans)


class GFG:
    def __init__(self,graph, seq):

        # residual graph
        self.graph = graph
        self.ppl = len(graph)
        self.jobs = len(graph[0])
        self.seq = seq

    # A DFS based recursive function
    # that returns true if a matching
    # for vertex u is possible
    def bpm(self, u, matchR, seen):

        # Try every job one by one
        for v in range(self.jobs-1,-1,-1):

            # If applicant u is interested
            # in job v and v is not seen
            if self.graph[u][v] and seen[v] == False:

                # Mark v as visited
                seen[v] = True

                '''If job 'v' is not assigned to
                   an applicant OR previously assigned
                   applicant for job v (which is matchR[v])
                   has an alternate job available.
                   Since v is marked as visited in the
                   above line, matchR[v]  in the following
                   recursive call will not get job 'v' again'''
                if matchR[v] == -1 or self.bpm(matchR[v],
                                               matchR, seen):
                    matchR[v] = u
                    return True
        return False

    # Returns maximum number of matching
    def maxBPM(self):
        '''An array to keep track of the
           applicants assigned to jobs.
           The value of matchR[i] is the
           applicant number assigned to job i,
           the value -1 indicates nobody is assigned.'''
        matchR = [-1] * self.jobs

        # Count of jobs assigned to applicants
        result = 0
        for i in self.seq:
            i -= 1
            # Mark all jobs as not seen for next applicant.
            seen = [False] * self.jobs

            # Find if the applicant 'u' can get a job
            if self.bpm(i, matchR, seen):
                result += 1
        # print(matchR)
        self.matchR = matchR
        return result
t = int(input())
for _ in range(t):
    n = int(input())
    b = list(map(int, input().split()))
    g = [[0 for _ in range(2*n)] for _ in range(2*n)]
    for i in b:
        for j in range(i,2*n):
            if j+1 not in b:
                g[i-1][j] = 1
    m = GFG(g, b)
    if m.maxBPM() != n:
        print(-1)
    else:
        for i in b:
            print(i, m.matchR.index(i-1)+1,  end=' ')
        print()


class GFG:
    def __init__(self,graph):

        # residual graph
        self.graph = graph
        self.ppl = len(graph)
        self.jobs = len(graph[0])

    # A DFS based recursive function
    # that returns true if a matching
    # for vertex u is possible
    def bpm(self, u, matchR, seen):

        # Try every job one by one
        for v in range(self.jobs):

            # If applicant u is interested
            # in job v and v is not seen
            if self.graph[u][v] and seen[v] == False:

                # Mark v as visited
                seen[v] = True

                '''If job 'v' is not assigned to
                   an applicant OR previously assigned
                   applicant for job v (which is matchR[v])
                   has an alternate job available.
                   Since v is marked as visited in the
                   above line, matchR[v]  in the following
                   recursive call will not get job 'v' again'''
                if matchR[v] == -1 or self.bpm(matchR[v],
                                               matchR, seen):
                    matchR[v] = u
                    return True
        return False

    # Returns maximum number of matching
    def maxBPM(self):
        '''An array to keep track of the
           applicants assigned to jobs.
           The value of matchR[i] is the
           applicant number assigned to job i,
           the value -1 indicates nobody is assigned.'''
        matchR = [-1] * self.jobs

        # Count of jobs assigned to applicants
        result = 0
        for i in range(self.ppl):

            # Mark all jobs as not seen for next applicant.
            seen = [False] * self.jobs

            # Find if the applicant 'u' can get a job
            if self.bpm(i, matchR, seen):
                result += 1
        #print(matchR)
        self.matchR = matchR
        return result
t = int(input())
for _ in range(t):
    n = int(input())
    b = list(map(int, input().split()))
    g = [[0 for _ in range(2*n)] for _ in range(2*n)]
    for i in b:
        for j in range(i,2*n):
            if j+1 not in b:
                g[j][i-1] = 1
    m = GFG(g)
    if m.maxBPM() != n:
        print(-1)
    else:
        for i in b:
            print(i, m.matchR[i-1]+1,  end=' ')
        print()


class GFG:
    def __init__(self,graph, seq):

        # residual graph
        self.graph = graph
        self.ppl = len(graph)
        self.jobs = len(graph[0])
        self.seq = seq

    # A DFS based recursive function
    # that returns true if a matching
    # for vertex u is possible
    def bpm(self, u, matchR, seen):

        # Try every job one by one
        for v in range(self.jobs):

            # If applicant u is interested
            # in job v and v is not seen
            if self.graph[u][v] and seen[v] == False:

                # Mark v as visited
                seen[v] = True

                '''If job 'v' is not assigned to
                   an applicant OR previously assigned
                   applicant for job v (which is matchR[v])
                   has an alternate job available.
                   Since v is marked as visited in the
                   above line, matchR[v]  in the following
                   recursive call will not get job 'v' again'''
                if matchR[v] == -1 or self.bpm(matchR[v],
                                               matchR, seen):
                    matchR[v] = u
                    return True
        return False

    # Returns maximum number of matching
    def maxBPM(self):
        '''An array to keep track of the
           applicants assigned to jobs.
           The value of matchR[i] is the
           applicant number assigned to job i,
           the value -1 indicates nobody is assigned.'''
        matchR = [-1] * self.jobs

        # Count of jobs assigned to applicants
        result = 0
        for i in reversed(self.seq):
            i -= 1
            # Mark all jobs as not seen for next applicant.
            seen = [False] * self.jobs

            # Find if the applicant 'u' can get a job
            if self.bpm(i, matchR, seen):
                result += 1
        # print(matchR)
        self.matchR = matchR
        return result
t = int(input())
for _ in range(t):
    n = int(input())
    b = list(map(int, input().split()))
    g = [[0 for _ in range(2*n)] for _ in range(2*n)]
    for i in b:
        for j in range(i,2*n):
            if j+1 not in b:
                g[i-1][j] = 1
    m = GFG(g, b)
    if m.maxBPM() != n:
        print(-1)
    else:
        for i in b:
            print(i, m.matchR.index(i-1)+1,  end=' ')
        print()


##############--->>>>> Deepcoder Amit Kumar Bhuyan <<<<<---##############

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
import sys
input = sys.stdin.readline
scanner = lambda: int(input())
string = lambda: input().rstrip()
get_list = lambda: list(read())
read = lambda: map(int, input().split())
get_float = lambda: map(float, input().split())
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1
    return x

def factorial(x, m):
	val = 1
	while x>0:
		val = (val * x) % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

## gcd function
def gcd(a,b):
    if b == 0:
        return a;
    return gcd(b, a % b);

## lcm function
def lcm(a, b):
	return (a * b) // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

## nCr function efficient using Binomial Cofficient
def nCr(n, k):
	if k > n:
		return 0
	if(k > n - k):
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

## upper bound function code -- such that e in a[:i] e < x;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p):
    if y == 0:
        return 1
    res = 1
    x = x % p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) :
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];

    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;

# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n):
    prime = [True for i in range(n+1)]
    prime[0], prime[1] = False, False
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime

# Euler's Toitent Function phi
def phi(n) :

    result = n
    p = 2
    while(p * p<= n) :
        if (n % p == 0) :
            while (n % p == 0) :
                n = n // p
            result = result * (1.0 - (1.0 / (float) (p)))
        p = p + 1
    if (n > 1) :
        result = result * (1.0 - (1.0 / (float)(n)))

    return (int)(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False

	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
def factoriazation(x):
    res = []
    for i in range(2, int(x ** 0.5) + 1):
    	while x % i == 0:
    		res.append(i)
    		x //= i
    if x != 1:
   		res.append(x)
    return res
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));

## taking string array input
def str_array():
    return input().strip().split();

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		# print(low, mid, high)
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

## for checking any conditions
def check(val, pair):
    summ = 0
    for x in pair:
        if x[1] > val:
            summ += x[0]
    return summ > val

## for sorting according to second position
def sortSecond(val):
	return val[1]

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
alphs = "abcdefghijklmnopqrstuvwxyz"

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal
# from sys import stdout
# import numpy as np
"""
_______________
rough work here
_______________

n piranhas with sizes a1, a2, .... an
scientist of berland state univ
want to find if there is dominant piranha
the piranha is dominant if
it can eat all the other
piranhas in the aquarium
piranha can eat only one of the adjacent piranhas during one move
piranha can do as many moves as it needs
piranha i can eat i - 1

"""

def solve():
    n = scanner()
    b = get_list()
    a = []
    vis = [0] * (2 * n)
    mp = {}
    for x in b:
        mp[x] = 1
        if x > 2 * n:
            print(-1)
            return
        vis[x - 1] =  1
    for x in b:
        a.append(x)
        mp[x] = 1
        for i in range(1, 201):
            if i > x and mp.get(i) == None:
                a.append(i)
                if i > 2 * n:
                    print(-1)
                    return
                vis[i - 1] = 1
                mp[i] = 1
                break
    if sum(vis) == 2 * n:
        print(*a)
    else:
        print(-1)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    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(b"\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()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    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()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    # sys.stdin = open("input.txt", "r")
    # sys.stdout = open("output.txt", "w")
    t = scanner()
    for i in range(t):
    	solve()
    #dmain()

# Comment Read()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))


testCases = int(input())
for i1 in range(testCases):
    length = int(input())
    taken = [False]*length*2
    b = list(map(int, input().split()))
    a = [0]*2*length
    for i2 in range(length):
        taken[b[i2] - 1] = True
        a[i2*2] = b[i2]
    if taken.index(True) > 0:
        print(-1)
    else:
        for i2 in range(length):
            for i3 in range(b[i2] , 2*length, 1):
                if not taken[i3]:
                    taken[i3] = True
                    a[(i2*2) + 1] = (i3 + 1)
                    break
        if 0 in a:
            print(-1)
        else:
            for i2 in a:
                print(i2,end=' ')
            print("")


testCases = int(input())
for i1 in range(testCases):
    length = int(input())
    taken = [False]*length*2
    b = list(map(int, input().split()))
    a = [0]*2*length
    for i2 in range(length):
        taken[b[i2] - 1] = True
        a[i2*2] = b[i2]
    if taken.index(True) > 0:
        print(-1)
    else:
        for i2 in range(length):
            for i3 in range(b[i2] , 2*length, 1):
                if not taken[i3]:
                    taken[i3] = True
                    a[(i2*2) + 1] = (i3 + 1)
                    break
        if 0 in a:
            print(-1)
        else:
            print(a)


t = int(input())
for _ in range(t):
  n = int(input())
  B = list(map(int, input().split()))
  cands = [True] * (2 * n)
  for b in B:
    cands[b - 1] = False
  ret = []
  for b in B:
    ret.append(b)
    for i in range(2 * n):
      if b < i + 1 and cands[i]:
        ret.append(i + 1)
        cands[i] = False
        break
    else:
      ret = [-1]
      break
  print(*ret)


for _ in range(int(input())):
    n=int(input())
    b=[int(x) for x in input().split()]
    a=[]
    for i in range(n):
        a.append(b[i])
        k=b[i]
        while k in a or k in b:k+=1
        if k>2*n:print(-1);break
        a.append(k)
    else:print(*a)


for _ in range(int(input())):
    n=int(input())
    a=list(map(int,input().split()))
    if 1 not in a or 2*n in a:print(-1)
    else:
        b=[];c=[a[0]]
        for i in range(1,2*n+1):
            if i not in a:b.append(i)
        for i in range(1,n+1):
            for j in range(n):
                if b[j] not in c and b[j]>a[i-1]:c.append(b[j]);break
            if i!=n:c.append(a[i])
        print(*c)


for _ in range(int(input())):
    n=int(input())
    a=list(map(int,input().split()))
    if 1 not in a or 2*n in a:print(-1)
    else:
        b=[]
        for i in range(2*n):
            if i%2==0:b.append(a.pop(0))
            else:b.append(0)
        c=[]
        for i in range(1,2*n+1):
            if i not in b:c.append(i)
        for i in range(1,2*n,2):
            for j in range(n):
                if c[j]>b[i-1]:
                    b[i]=c[j];c.pop(j);break
        print(*b)


for _ in range(int(input())):
    n=int(input())
    a=list(map(int,input().split()))
    if 1 not in a or 2*n in a:print(-1)
    else:
        b=[0 for i in range(2*n)]
        for i in range(n):b[i*2]=a[i]
        c=[]
        for i in range(1,2*n+1):
            if i not in b:c.append(i)
        for i in range(1,2*n,2):
            for j in range(n):
                if c[j]>b[i-1]:
                    b[i]=c[j];c.pop(j);break
        print(*b)


# restoring_permutation1.py
from collections import defaultdict
for _ in range(int(input())):
    n = int(input())
    b = list(map(int,input().split()))
    mydick = dict()
    mydick = defaultdict(lambda:0,mydick)
    for i in range(n):
        mydick[b[i]]=1
    p = 2*n
    a = []
    a.append(b[0])
    ok = True
    if mydick[p]==1:
        ok = False
    for i in range(n-1):
        if b[i+1]-b[i]>1:
            # x =  abs(b[i+1]-b[i])
            j = b[i]+1
            while j<b[i+1]:
                if mydick[j]!=1:
                    a.append(j)
                    mydick[j]=1
                    break
                j+=1
        elif b[i]-b[i+1]>1:
            j = b[i]-1
            while j>b[i+1]:
                if mydick[j]!=1:
                    a.append(j)
                    mydick[j]=1
                    break
                j+=1
        else:
            ok = False
        a.append(b[i+1])

    if ok and p-b[n-1]>=1:
        j = b[n-1]
        while j<=p:
            if mydick[j]!=1:
                a.append(j)
                mydick[j]=1
                break
            j+=1
        print(*a)
    else:
        print(-1)


# common_prefix.py
for _ in range(int(input())):
    n = int(input())
    l = list(map(int,input().split()))
    if l[0]!=0:

        print('a'*l[0])
    else:
        print('a')
    k = 97
    # print(k)
    for i in range(1,n):
        if l[i]>l[i-1] and l[i-1]!=0 and l[i]!=0:
            print(chr(k)*l[i])
        elif l[i-1]>=l[i] and l[i-1]!=0 and l[i]!=0:
            print(chr(k)*l[i-1])
        else:
            k+=1
            x = max(l[i],l[i-1])
            if x == 0:
                print(chr(k))
            else:
                print(chr(k)*x)
    if l[n-1]==0:
        k+=1
        print(chr(k))
    else:
        print(chr(k)*l[n-1])


# restoring_permutation1.py
from collections import defaultdict
for _ in range(int(input())):
    n = int(input())
    b = list(map(int,input().split()))
    mydick = dict()
    mydick = defaultdict(lambda:0,mydick)
    for i in range(n):
        mydick[b[i]]=1
    p = 2*n
    a = []
    # a.append(b[0])
    ok = True
    if mydick[p]==1:
        print(-1)
        continue
    for i in range(n):
        a.append(b[i])
        if p-b[i]>=1:
            j = b[i]+1
            while j<=p:
                if mydick[j]!=1:
                    a.append(j)
                    mydick[j]=1
                    break
                j+=1
            # a.append(j)

    if len(a)==p:
        print(*a)
    else:
        print(-1)


gets.to_i.times do
	n = gets.to_i
	a = gets.split.map &:to_i
	b = (1..(2*n)).select{|i| !a.include?(i)}
	c = Array.new(n, 1)
	flag = false
	c.each_index do |i|
		pos = b.index{|x| x > a[i]}
		if pos
			c[i] = b[pos]
			b.delete_at(pos)
		else
			flag = true
		end
	end
	if flag
		puts -1
	else
		puts (0...n).to_a.map{|i| [a[i], c[i]]}.flatten.join(' ')
	end
end


from collections import defaultdict as dd, Counter, OrderedDict as od, deque
from itertools import combinations as comb, permutations as perm
from functools import reduce
from math import log, ceil, floor
from fractions import gcd

import os, sys

#sys.stdin = open("pc.txt", "r")
raw_input = sys.stdin.readline

int_input = lambda : int(raw_input())
list_input = lambda : list(raw_input().strip())
explode_input = lambda sep :raw_input().split(sep)
format_input = lambda object : map(object, raw_input().split())

t = int_input()

for t_itr in xrange(t):
	n = int_input()
	b = format_input(int)

	ans = []
	used = Counter(b)

	for n_itr in xrange(n):
		x, y = b[n_itr], b[n_itr] + 1

		if used.get(x, -1) != -1:
			used[x] -= 1
			if used[x] < 1:
				used.pop(x)

			for x_itr in xrange(x, 2 * n + 1):
				if used.get(x_itr, -1) == -1:
					ans.append(x_itr)
					used[x_itr] = 1
					y = x_itr + 1
					break

			for y_itr in xrange(y, 2 * n + 1):
				if used.get(y_itr, -1) == -1:
					ans.append(y_itr)
					used[y_itr] = 1
					break

	m = len(ans)
	t = m != 2 * n

	for x in ans:
		if x > 2 * n:
			t = 1
			break

	if t == 1:
		print "-1"
	else:
		print " ".join(map(str, ans))


import math
import heapq
import sys
num = int(raw_input())
for i in range(num):
    n = int(raw_input())
    nums = [int(x) for x in raw_input().split(" ")]
    if 1 not in nums:
        print("-1")
        continue
    cur_set = set()
    for nn in nums:
        cur_set.add(nn)
    ans = []
    flag = 0
    for nn in nums:
        ans.append(str(nn))
        c = nn+1
        while c in cur_set and c<=2*n:
            c+=1
        if c>2*n:
            flag = 1
            break
        ans.append(str(c))
        cur_set.add(c)
    if flag == 1:
        print("-1")
        continue
    print(" ".join(ans))


import math
import heapq
import sys
num = int(raw_input())
for i in range(num):
    n = int(raw_input())
    nums = [int(x) for x in raw_input().split(" ")]
    if 1 not in nums:
        print("-1")
        continue
    cur_set = set()
    for n in nums:
        cur_set.add(n)
    ans = []
    flag = 0
    for nn in nums:
        ans.append(str(nn))
        c = nn+1
        while c in cur_set and c<=2*n:
            c+=1
        if c>2*n:
            flag = 1
            break
        ans.append(str(c))
        cur_set.add(c)
    if flag == 1:
        print("-1")
        continue
    print(" ".join(ans))


def get_rank(input):
  indices = list(range(len(input)))
  indices.sort(key=lambda x: input[x])
  output = [0] * len(indices)
  for i, x in enumerate(indices):
    output[x] = i
  return output

cases = int(raw_input().strip())
for case in range(cases):
  n = int(raw_input().strip())
  b = map(int, raw_input().strip().split(" "))
  a = [0 for i in xrange(2 * n)]
  for i in range(n):
    a[i * 2] = b[i]
  perm = sorted(list(set(xrange(1, 2 * n + 1)) - set(b)))
  rank = get_rank(b)
  for i in range(n):
    a[i * 2 + 1] = perm[rank[i]]
  possible = True
  for i in range(n):
    if b[i] != min(a[i * 2], a[i * 2 + 1]):
      possible = False
      break
  if not possible:
    print "-1"
  else:
    for i in range(n):
      min_possible = a[i * 2 + 1]
      min_j = i
      for j in range(i + 1, n):
        if a[j * 2 + 1] > a[i * 2] and min_possible > a[j * 2 + 1]:
          min_possible = a[j * 2 + 1]
          min_j = j
      if min_j != i:
        a[i * 2 + 1], a[min_j * 2 + 1] = a[min_j * 2 + 1], a[i * 2 + 1]
    print ' '.join(map(str, a))


from bisect import bisect
for _ in range(input()):
    n = input()
    a = map(int,raw_input().split())
    if 1 not in a or 2*n in a:
        print -1
        continue
    l = []
    for i in range(1,2*n+1):
        if i not in a:
            l.append(i)
    d = {}
    for i in range(n):
        p = bisect(l,a[i])
        d[a[i]] = l[p]
        l.remove(l[p])
    for i in range(n):
        print a[i],d[a[i]],
    print


from bisect import bisect
for _ in range(input()):
    n = input()
    a = map(int,raw_input().split())
    if 1 not in a or 2*n in a:
        print -1
        continue
    l = []
    for i in range(1,2*n+1):
        if i not in a:
            l.append(i)
    d = {}
    f = 0
    for i in range(n):
        p = bisect(l,a[i])
        if p==len(l):
            f = 1
            break
        d[a[i]] = l[p]
        l.remove(l[p])
    if f==1:
        print -1
        continue
    for i in range(n):
        print a[i],d[a[i]],
    print


for _ in range(input()):
    n = input()
    a = map(int,raw_input().split())
    if 1 not in a or 2*n in a:
        print -1
        continue
    l = []
    for i in range(1,2*n+1):
        if i not in a:
            l.append(i)
    b = a[:]
    b.sort()
    d = {}

    for i in range(n)[::-1]:
        d[b[i]] = l[-1]
        l.pop()
    for i in range(n):
        print a[i],d[a[i]],
    print


from bisect import bisect
for _ in range(input()):
    n = input()
    a = map(int,raw_input().split())
    if 1 not in a or 2*n in a:
        print -1
        continue
    l = []
    for i in range(1,2*n+1):
        if i not in a:
            l.append(i)
    d = {}
    for i in range(n):
        p = bisect(l,a[i])
        d[a[i]] = l[p]
        l = l[:p] + l[p+1:]
    for i in range(n):
        print a[i],d[a[i]],
    print


#include <stdio.h>
#include<math.h>
int main()
{
   int t;
   scanf("%d",&t);
   while(t--)
   {
       int n;
       scanf("%d",&n);
       int b[n+1],present[2*n+1],a[2*n+1];
       for(int i=1;i<=2*n;i++)
       present[i]=0;
       for(int i=1;i<=n;i++)
       {
           scanf("%d",&b[i]);
           present[b[i]]++;
       }
       if(present[2*n]==1)
           printf("-1\n");
       else
       {
           int count=n,flag=0;
           for(int i=1;i<=n;i++)
           {
               int j=b[i];
               while(present[++j]==1&&j<=2*n);
               if(j==2*n+1&&count!=0)
               {
                   printf("-1\n");
                   flag=1;
                   break;
               }
               else
               {
                   a[2*i-1]=b[i];
                   a[2*i]=j;
                   present[j]=1;
                   count--;
               }
           }
           if(flag==0)
           {
               for(int i=1;i<=2*n;i++)
               printf("%d ",a[i]);
               printf("\n");
           }
       }
   }
   return 0;
}


#include <stdio.h>

int main() {
	int t;
	scanf("%d", &t);
	while (t--) {
		int n;
		scanf("%d", &n);
		int flag[2*n+1], arr[n];
		for (int i=1;i<=2*n;i++) flag[i]=0;
		for (int i=0;i<n;i++) {
			scanf("%d", &arr[i]);
			flag[arr[i]]=1;
		}
		int ans[2*n], idx=0;
		for (int i=0;i<n;i++) {
			ans[idx++]=arr[i];
			for (int j=arr[i]+1;j<=2*n;j++) {
				if (flag[j]==0) {
					ans[idx++]=j;
					flag[j]=1;
					break;
				}
			}
			flag[arr[i]]=1;
		}
		int f=1;
		for (int i=1;i<=2*n;i++) {
			if (flag[i]==0) f=0;
		}
		if (f) {
			for (int i=0;i<idx;i++) printf("%d ", ans[i]);
		}
		else printf("-1");
		printf("\n");
	}
}


/*  AUTHOR: AKASH JAIN
*   EMAIL:  akash19jain@gmail.com
*   ID:     akash19jain
*   DATE:   23-02-2020 22:21:47
*/

// #include<algorithm>
// #include <bits/stdc++.h>
// using namespace std;

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
#define SC1(x)          scanf("%lld",&x)
#define SC2(x,y)        scanf("%lld%lld",&x,&y)
#define SC3(x,y,z)      scanf("%lld%lld%lld",&x,&y,&z)
#define SCS(x)          scanf("\n%s", x)
#define SCA(a,n)        for(long long i=0;i<n;i++)    scanf("%lld",&a[i]);
#define PF1(x)          printf("%lld\n",x)
#define PF2(x,y)        printf("%lld %lld\n",x,y)
#define PF3(x,y,z)      printf("%lld %lld %lld\n",x,y,z)
#define PFA(a,n)        for(long long i=0;i<n;i++)    printf("%lld ",a[i]); printf("\n");
#define PFN             printf("\n")
#define PFS(x)          printf("%s\n",x)
#define REP(i,n)        for(long long i=0;i<(n);++i)
#define FOR(i,a,b)      for(long long i=(a);i<=(b);++i)
#define FORD(i,a,b)     for(long long i=(a);i>=(b);--i)
#define WHILE(n)        while(n--)
#define MEM(a, b)       memset(a, (b), sizeof(a))
#define ITOC(c)         ((char)(((ll)'0')+c))
#define MID(s,e)        (s+(e-s)/2)
#define SZ(a)           strlen(a)
#define PI              3.1415926535897932384626433832795
#define DEB(x)          printf("The value of \"%s\" is: %d\n",#x,x)
#define CASES           ll t;SC1(t);while(t--)
#define ABS(a)          ((a>0)?a:-(a))
#define SWAP(a,b)       ll z=a;a=b;b=z
#define SWAPC(a,b)      char z=a;a=b;b=z
#define FLSH            fflush(stdout)
typedef long long ll;
typedef unsigned long long ull;
const ll INF = 1<<29;
const ll MOD = 1000000007;
const ll FMOD = 998244353;
const ll MAX = 10000000005;
const ll MIN = -10000000005;
#define FILEIO(name) \  freopen(name".in", "r", stdin); \   freopen(name".out", "w", stdout);
int cmp(const void * a,const void * b);
long long maxv(long long a,long long b);
long long minv(long long a,long long b);
long long gcd(long long u,long long v);
long long digits(long long n);
bool ispoweroftwo(long long n);
bool isvowel(char x);
ll chartoint(char ch);
ll CEIL(ll x,ll y);
ll FLOOR(ll x,ll y);

int main()
{
    CASES
    {
        ll n;
        SC1(n);
        ll final=2*n;
        ll b[n];
        ll count[205];
        ll a[final+1];
        MEM(count,0);
        ll f=0;
        REP(i,n)
        {
            SC1(b[i]);
            count[b[i]]=1;
            if(b[i]==2*n)
            {
                f=1;
            }
        }
        // PFA(b,n);
        if(f)
        {
            PFS("-1");
            continue;
        }
        ll f1=0;
        REP(i,n)
        {
            f1=0;
            ll x=b[i];
            a[(2*i)]=x;
            //DEB(x);
            //DEB(x);
            FOR(j,x+1,final)
            {
                if(count[j]==0)
                {
                    count[j]=1;
                    a[(2*i)+1]=j;
                    //DEB(j);
                    f1=1;
                    break;
                }
            }
            if(f1==0)
            {
                f=1;
                break;
            }
        }
        if(f)
        {
            PFS("-1");
            continue;
        }
        REP(i,2*n)
        {
            printf("%lld ",a[i]);
        }
        PFN;

    }
    return 0;
}

//qsort(arr,n,sizeof(arr[0]),cmp);
int cmp (const void * a, const void * b)
{
    if( *(ll*)a - *(ll*)b < 0 ) return -1;
    if( *(ll*)a - *(ll*)b > 0 ) return 1;
        return 0;
}
long long maxv(long long a,long long b)
{
    if(a>b) return a;
        return b;
}
long long minv(long long a,long long b)
{
    if(a<b) return a;
        return b;
}
long long gcd(long long u,long long v)
{
    if (v == 0) return u;
       return gcd(v, u%v);
}
long long digits(long long n)    //to calculate no of digits in a number
{
    return floor(log10(n))+1;
}
bool ispoweroftwo(long long x)
{
    return x && (!(x&(x-1)));
}
bool isvowel(char x)
{
    return(x=='a' || x== 'e' ||x=='i' || x== 'o' || x=='u' );
}
ll chartoint(char ch)
{
    if(ch>='A' && ch<='Z') return(ch-'A');
    else if(ch>='0' && ch<='9') return (ch-'0');
    else if(ch>='a' && ch<='z') return (ch-'a');
    else return 0;
}
ll CEIL(ll x,ll y)
{
    if(x%y==0) return(x/y);
    else return(x/y +1);
}

ll FLOOR(ll x,ll y)
{
    if(x%y==0) return(x/y);
    else return(x/y -1);
}


#include<stdio.h>

int main()
{
    int t,c;
    scanf("%d",&t);
    for(c=0; c<t; c++)
    {
        int n,i,j,k,l,a,b,d=0;
        scanf("%d",&n);
        int element[2*n];

        for(j=0; j<2*n; j+=2)
        {
            scanf("%d",&element[j]);

        }

        for(j=0,k=1; k<2*n; k+=2,j+=2)
        {
            for(b=0,l=1; b<2*n; b+=2)
            {
                if(b==j)
                    b+=2;
                if(element[j]+l==element[b])

                    l++;

            }
            for(a=1; a<k; a+=2)
            {
                if(element[j]+l==element[a])
                    l++;

            }

            element[k]=element[j]+l;
            if(element[k]>2*n)
            {   d=-1;
                printf("%d",d);

            break;
            }

        }
        for(i=0; i<2*n&&d!=-1; i++)
            printf("%d ",element[i]);

    }

}


#include<stdio.h>

int main()
{
    int t,i,j,k,l,a,b,c;
    scanf("%d",&t);
    for(i=0; i<t; i++)
    {
        int n;
        scanf("%d",&n);
        int element[2*n];

        for(j=0; j<2*n; j+=2)
        {
            scanf("%d",&element[j]);

        }

        for(j=0,k=1; k<2*n; k+=2,j+=2)
        {
            for(b=0,l=1; b<2*n; b+=2)
            {
                if(b==j)
                    b+=2;
                if(element[j]+l==element[b])

                    l++;

            }
            for(a=1; a<k; a+=2)
            {
                if(element[j]+l==element[a])
                    l++;

            }

            element[k]=element[j]+l;
            if(element[k]>2*n)
            {
                printf("-1");

            break;
            }

        }
if(element[k]>2*n) break;
        for(i=0; i<2*n; i++)
            printf("%d ",element[i]);

    }

}


#include<stdio.h>

int main()
{
    int t,c;
    scanf("%d",&t);
    for(c=0; c<t; c++)
    {
        int n,i,j,k,l,a,b,d=0;
        scanf("%d",&n);
        int element[2*n];

        for(j=0; j<2*n; j+=2)
        {
            scanf("%d",&element[j]);

        }

        for(j=0,k=1; k<2*n; k+=2,j+=2)
        {
            for(b=0,l=1; b<2*n; b+=2)
            {   lebel:
                if(b==j)
                    b+=2;

                if(element[j]+l==element[b])

                    l++;

            }
            for(a=1; a<k; a+=2)
            {
                if(element[j]+l==element[a])
                   {
                        b=0;
                       l++;
                       goto lebel;
                   }

            }

            element[k]=element[j]+l;
            if(element[k]>2*n)
            {   d=-1;
                printf("%d",d);

            break;
            }

        }
        for(i=0; i<2*n&&d!=-1; i++)
            printf("%d ",element[i]);
    printf("\n");
    }

}


#include<stdio.h>

int main()
{
    int t,c;
    scanf("%d",&t);
    for(c=0; c<t; c++)
    {
        int n,i,j,k,l,a,b,d=0;
        scanf("%d",&n);
        int element[2*n];

        for(j=0; j<2*n; j+=2)
        {
            scanf("%d",&element[j]);

        }

        for(j=0,k=1; k<2*n; k+=2,j+=2)
        {
            for(b=0,l=1; b<2*n; b+=2)
            {   lebel:
                if(b==j)
                    b+=2;

                if(element[j]+l==element[b])
                {
                    l++;
                    b=0;
                    goto lebel;

                }
            }
            for(a=1; a<k; a+=2)
            {
                if(element[j]+l==element[a])
                   {
                        b=0;
                       l++;
                      goto lebel;
                   }

            }

            element[k]=element[j]+l;
            if(element[k]>2*n)
            {   d=-1;
                printf("%d",d);

            break;
            }

        }
        for(i=0; i<2*n&&d!=-1; i++)
            printf("%d ",element[i]);
    printf("\n");
    }

}


#include<stdio.h>

int main()
{
    int t,c;
    scanf("%d",&t);
    for(c=0; c<t; c++)
    {
        int n,i,j,k,l,a,b,d=0;
        scanf("%d",&n);
        int element[2*n];

        for(j=0; j<2*n; j+=2)
        {
            scanf("%d",&element[j]);

        }

        for(j=0,k=1; k<2*n; k+=2,j+=2)
        {
            for(b=0,l=1; b<2*n; b+=2)
            {
                if(b==j)
                    b+=2;
                if(element[j]+l==element[b])

                    l++;

            }
            for(a=1; a<k; a+=2)
            {
                if(element[j]+l==element[a])
                    l++;

            }

            element[k]=element[j]+l;
            if(element[k]>2*n)
            {   d=-1;
                printf("%d",d);

            break;
            }

        }
        for(i=0; i<2*n&&d!=-1; i++)
            printf("%d ",element[i]);
    printf("\n");
    }

}


#include<stdio.h>
#include<stdbool.h>
#include<string.h>

int a[201], pos[201];

int main(){
	int t;
	scanf("%d", &t);
	while(t--){
		int n, i, j, l;
		scanf("%d", &n);
		memset(pos, -1, sizeof(pos));
		for(i=0;i<n;++i){
			scanf("%d", a+2*i);
			pos[a[2*i]]=i;
		}
		n*=2;
		bool ok=true;
		for(i=n;i;--i){
			if(pos[i]!=-1) continue;
			int curr=1;
			for(j=i-1;j>-1 && curr;--j){
				if(pos[j]==-2) continue;
				if(pos[j]!=-1) --curr;
				else ++curr;
			}
			if(j==-1){
				ok=false;
				break;
			}
			for(;j<i;++j) if(pos[j]>-1) break;
			l=j;
			for(++j;j<i;++j) if(pos[j]>pos[l]) l=j;
			a[2*pos[l]+1]=i;
			pos[l]=-2;
		}
		if(ok){
			for(i=0;i<n;++i) printf("%d ", a[i]);
			putchar(10);
		}
		else puts("-1");
	}
	return 0;
}


#include<stdio.h>
int search(int x,int arr[],int n){
    int count=0;
    for(int i=0;i<n;i++){
        if(x==arr[i])
            count++;
    }
    if(count)
        return 1;
    else
        return 0;
}
int main(){
    int t;
    scanf("%d",&t);
    for(int i=1;i<=t;i++){
        int n;
        scanf("%d",&n);
        int b[n],a[2*n];
        for(int i=0;i<n;i++){
            scanf("%d",&b[i]);
            a[2*i]=b[i];
            a[2*i+1]=0;
        }
        for(int i=0;i<n;i++){
            int m=1;
            while(1){
                if(search(a[2*i]+m,a,2*n))
                    m++;
                else{
                    a[2*i+1]=a[2*i]+m;
                    break;
                }
            }
        }
        int flag=1;
        for(int i=0;i<2*n;i++)
            if(!search(i+1,a,2*n)){
                printf("-1\n");
                flag=0;
                break;
            }
        if(flag==1){
            for(int i=0;i<2*n;i++){
                printf("%d ",a[i]);
            }
            printf("\n");
        }
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,k,t,n,l,largest_element;
    scanf("%d",&t);
    int result[t][200];
    int largest_element_array[t];

    for(i=0;i<t;i++)
    {
        int count=0;
        scanf("%d",&n);
        largest_element=2*n;
        largest_element_array[i]=largest_element;
        int array_given[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&array_given[j]);
        }
        int smallest_element=100000000;
        for(j=0;j<n;j++)
        {
            if(array_given[j]<smallest_element)
            {
                smallest_element=array_given[j];
            }
        }
        for(j=0;j<n;j++)
        {
            if(array_given[j]>=largest_element)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;
                break;
            }
        }
        int n_r_elements=0;
        if(!count)
        {
            int array_remaining[largest_element];
            for(k=smallest_element+1;k<=largest_element;k++)
            {
                int exists=0;
                for(l=0;l<n;l++)
                {
                    if(k==array_given[l])
                    {
                        exists=1;
                        break;
                    }

                }
                if(!exists)
                    {
                        array_remaining[n_r_elements]=k;
                        n_r_elements+=1;
                    }
            }
            if(n_r_elements<n)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;

            }
            else{
                int array[n];
                for(k=0;k<n;k++)
                {
                    array[k]=1;
                }
                for(k=0;k<n;k++)
                {
                    result[i][2*k]=array_given[k];
                }
                for(k=0;k<n;k++)
                {
                    count=0;
                    for(l=0;l<n;l++)
                    {
                        if(array[l]&&(array_remaining[l]>array_given[k]))
                           {
                               result[i][2*k+1]=array_remaining[l];
                               count+=1;
                           }
                        if(count)
                        {
                            array[l]=0;
                            break;
                        }
                    }
                }
            }
        }

    }
    for(i=0;i<t;i++)
    {
        for(j=0;(result[i][j]&&(j<largest_element_array[i]));j++)
        {
            printf("%d ",result[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,k,t,n,l,largest_element;
    scanf("%d",&t);
    int result[t][200];
    int largest_element_array[t];

    for(i=0;i<t;i++)
    {
        int count=0;
        scanf("%d",&n);
        largest_element=2*n;
        largest_element_array[i]=largest_element;
        int array_given[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&array_given[j]);
        }
        int smallest_element=100000000;
        for(j=0;j<n;j++)
        {
            if(array_given[j]<smallest_element)
            {
                smallest_element=array_given[j];
            }
        }
        for(j=0;j<n;j++)
        {
            if(array_given[j]>=largest_element)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;
                break;
            }
        }
        int n_r_elements=0;
        if(!count)
        {
            int array_remaining[largest_element];
            for(k=smallest_element+1;k<=largest_element;k++)
            {
                int exists=0;
                for(l=0;l<n;l++)
                {
                    if(k==array_given[l])
                    {
                        exists=1;
                        break;
                    }

                }
                if(!exists)
                    {
                        array_remaining[n_r_elements]=k;
                        n_r_elements+=1;
                    }
            }
            if(n_r_elements<n)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;

            }
            else{
                int array[n];
                for(k=0;k<n;k++)
                {
                    array[k]=1;
                }
                for(k=0;k<n;k++)
                {
                    result[i][2*k]=array_given[k];
                }
                for(k=0;k<n;k++)
                {
                    count=0;
                    result[i][2*k+1]=0;
                    for(l=0;l<n;l++)
                    {

                        if(array[l]&&(array_remaining[l]>array_given[k]))
                           {
                               result[i][2*k+1]=array_remaining[l];
                               count+=1;
                           }
                        if(count)
                        {
                            array[l]=0;
                            break;
                        }
                    }
                    int exit_2=0;
                    for(l=0;l<n;l++)
                    {
                        if(result[i][2*l+1]==0)
                        {
                            result[i][0]=-1;
                            result[i][1]=0;
                            exit_2=1;
                        }
                    }
                    if(exit_2)
                        break;
                }
            }
        }

    }
    for(i=0;i<t;i++)
    {
        for(j=0;(result[i][j]&&(j<largest_element_array[i]));j++)
        {
            printf("%d ",result[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int i,j,k,t,n,l,largest_element;
    scanf("%d",&t);
    int result[t][200];
    int largest_element_array[t];

    for(i=0;i<t;i++)
    {
        int count=0;
        scanf("%d",&n);
        largest_element=2*n;
        largest_element_array[i]=largest_element;
        int array_given[n];
        for(j=0;j<n;j++)
        {
            scanf("%d",&array_given[j]);
        }
        int smallest_element=100000000;
        for(j=0;j<n;j++)
        {
            if(array_given[j]<smallest_element)
            {
                smallest_element=array_given[j];
            }
        }
        for(j=0;j<n;j++)
        {
            if(array_given[j]>=largest_element)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;
                break;
            }
        }
        int n_r_elements=0;
        if(!count)
        {
            int array_remaining[largest_element];
            for(k=smallest_element+1;k<=largest_element;k++)
            {
                int exists=0;
                for(l=0;l<n;l++)
                {
                    if(k==array_given[l])
                    {
                        exists=1;
                        break;
                    }

                }
                if(!exists)
                    {
                        array_remaining[n_r_elements]=k;
                        n_r_elements+=1;
                    }
            }
            if(n_r_elements<n)
            {
                result[i][0]=-1;
                result[i][1]=0;
                count+=1;

            }
            else{
                int array[n];
                for(k=0;k<n;k++)
                {
                    array[k]=1;
                }
                for(k=0;k<n;k++)
                {
                    result[i][2*k]=array_given[k];
                }
                for(k=0;k<n;k++)
                {
                    count=0;
                    result[i][2*k+1]=0;
                    for(l=0;l<n;l++)
                    {

                        if(array[l]&&(array_remaining[l]>array_given[k]))
                           {
                               result[i][2*k+1]=array_remaining[l];
                               count+=1;
                           }
                        if(count)
                        {
                            array[l]=0;
                            break;
                        }
                    }
                }
                for(k=0;k<n;k++)
                {
                    if(result[i][2*k+1]==0)
                        {
                            result[i][0]=-1;
                            result[i][1]=0;
                        }
                }
            }
        }

    }
    for(i=0;i<t;i++)
    {
        for(j=0;(result[i][j]&&(j<largest_element_array[i]));j++)
        {
            printf("%d ",result[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#include<stdio.h>

void clearPresent (int p[],int size){
    for (int i = 0;i<size;++i)
        p[i]=0;
}

int main(){
    int t,n,flag;
    scanf ("%d",&t);
    while (t--){

        flag = 1;
        scanf ("%d",&n);
        int b[n+1], a[(2*n)+1];
        int present[(2*n)+1];

        clearPresent(present,((2*n)+1));
        clearPresent(b,n+1);
        clearPresent(a,(2*n)+1);

        for (int i = 1; i <= n; ++i)
            scanf("%d",&b[i]);

        for (int i=1;i<=n;++i)
            present[b[i]]=1;

        for (int i = 1; i <= n; i++)
            a[2*i-1] = b[i];

        for (int i = 1; i <= n; ++i ){
            for (int j = b[i]+1; j <= 2*n; ++j){
                if (present[j] == 0){
                    a[2*i]=j;
                    present[j]=1;
                    break;
                }
            }
        }
        for (int i = 1 ;i<=2*n; ++i){
            if(a[i]==0){
                printf("-1\n");
                flag=-1;
                break;
            }
        }
        if (flag == -1)
            continue;
        else {
            for (int i = 1; i<=2*n; ++i)
                printf("%d ",a[i]);
            printf("\n");
        }
    }
    return 0;
}


#include <stdio.h>
int main()
{
	int t;
    scanf("%d",&t);
	while(t--)
	{
	    int i,n,failure_flag=0;
	    scanf("%d",&n);
	    int doub=2*n;
	    int all[doub],perm[doub],b[n];
	    for(i=0;i<doub;i++)
	        all[i]=0;
	    for(i=0;i<n;i++)
	    {
	        scanf("%d",&b[i]);
	        all[b[i]-1]=1;
	        perm[2*i]=b[i];
	    }
	    if(all[doub-1]==1 || all[0]==0)
	    {
	        printf("-1\n");
	        continue;
	    }
	    for(i=1;i<doub;i+=2)
	    {
	        int num=b[i/2],j;
	        for(j=num;j<doub;j++)
	        {
	            if(all[j]==1)
	                continue;
	            perm[i]=j+1;
	            all[j]=1;
	            break;
	        }
	        if(j==doub)
	        {
	            failure_flag=1;
	            break;
	        }
	    }
	    if(failure_flag)
	    {
	        printf("-1\n");
	        continue;
	    }

	    for(i=0;i<doub;i++)
	    {
           printf("%d ",perm[i]);
	    }
	    printf("\n");
	}
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;

int main()
{
	int num;
	cin >> num;
	int* stack = new int[num];
	int* hash = new int[num];
	//	int* steps = new int[num];

	for (int i = 0; i < num; ++i)
	{
		scanf("%d",&stack[i]);
		hash[--stack[i]] = i;
	}
	int oldMax = -1;
	int remIndex;
	for (int i = 0; i < num; ++i)
	{
		int step;
		scanf("%d",&step);
		remIndex = hash[step - 1];

		if (remIndex > oldMax)
		{
			printf("%d ", (remIndex - oldMax));
			oldMax = remIndex;
		}
		else
		{
			printf("0 ");
		}
	}
	//cout << endl;
	//	system("pause");
}


#include <iostream>
using namespace std;

int main()
{
	int num;
	cin >> num;
	int* stack = new int[num];
	int* hash = new int[num];
//	int* steps = new int[num];

	for (int i = 0; i < num; ++i)
	{
		cin >> stack[i];
		hash[--stack[i]] = i;
	}
	int oldMax = -1;
	int remIndex;
	int step;
	for (int i = 0; i < num; ++i)
	{
		cin >> step;
		remIndex = hash[step-1];

		if (remIndex <= oldMax)
		{
			if(num != 200000)
				cout << 0 << " ";
		}
		else
		{
			cout << (remIndex - oldMax) << " ";
			oldMax = remIndex;
		}
	}
	cout << endl;
//	system("pause");
}


// Author : Dhiraj Gandhi.
// Institute : PICT,Pune.

#include<bits/stdc++.h>
using namespace std;
//#define int long long int
#define endl '\n'

struct abc{int ind,val;};
bool compare(abc x1,abc x2){return (x1.val<x2.val);}

int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int min(int a,int b){if(a<b)return a;return b;}
bool isprime(int n){if(n==1)return false;
for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}
const int N=2e5+3,A=1e6+3;
const int MOD=1000000007;
int a[200005],k;
int32_t main(){
	int n,x;
	cin>>n;
	for(int i=1;i<=n;i++){
		scanf("%d",&x);
		a[x]=i;
	}
	while(n--){
		scanf("%d",&x);
		int j=0;
		if(a[x]>k)
		{j=a[x]-k;
		k=a[x];}
		printf("%d ",j);
	}
}


// Author : Dhiraj Gandhi.
// Institute : PICT,Pune.

#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'

struct abc{int ind,val;};
bool compare(abc x1,abc x2){return (x1.val<x2.val);}

int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int min(int a,int b){if(a<b)return a;return b;}
bool isprime(int n){if(n==1)return false;
for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}
const int N=2e5+3,A=1e6+3;
const int MOD=1000000007;
int a[200005],k;
int32_t main(){
	int n,x;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		a[x]=i;
	}
	for(int i=0;i<n;i++){
		cin>>x;
		int j=0;
		if(a[x]>k)
		{j=a[x]-k;
		k=a[x];}
		cout<<j<<' ';
	}
}


// Author : Dhiraj Gandhi.
// Institute : PICT,Pune.

#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'

struct abc{int ind,val;};
bool compare(abc x1,abc x2){return (x1.val<x2.val);}

int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int min(int a,int b){if(a<b)return a;return b;}
bool isprime(int n){if(n==1)return false;
for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}
const int N=2e5+3,A=1e6+3;
const int MOD=1000000007;
int a[200005],k;
int32_t main(){
	int n,x;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x;
		a[x]=i;
	}
	for(int i=0;i<n;i++){
		cin>>x;
		int j=0;
		if(a[x]>k){
			j=a[x]-k;
		}
		k=max(k,a[x]);
		cout<<j<<' ';
	}
}


// Author : Dhiraj Gandhi.
// Institute : PICT,Pune.

#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'

struct abc{int ind,val;};
bool compare(abc x1,abc x2){return (x1.val<x2.val);}

int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int min(int a,int b){if(a<b)return a;return b;}
bool isprime(int n){if(n==1)return false;
for(int i=2;i*i<=n;i++){if(n%i==0)return false;}return true;}
const int N=2e5+3,A=1e6+3;
const int MOD=1000000007;

int32_t main(){
	int n,x;
	cin>>n;
	vector<int>v;
	vector<int>::iterator it,it1;
	for(int i=0;i<n;i++){
		cin>>x;
		v.push_back(x);
	}
	it1=v.begin();
	for(int i=0;i<n;i++){
		cin>>x;
		it=find(v.begin(),v.end(),x);
		if(it!=v.end()){
			cout<<it-v.begin()+1<<' ';
			v.erase(it1,it+1);
		}
		else cout<<0<<' ';
	}
}


// Author : Dhiraj Gandhi.
// Institute : PICT,Pune.

#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define double long double
#define f1 first
#define s1 second
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define test int t;cin>>t;while(t--)
#define pie 3.1415926536
#define all(c) c.begin(), c.end()
typedef vector<int>vi;
typedef pair<int,int>pii;
typedef vector<pair<int,int>>vii;
struct abc{int x,y;};
bool compare(abc a1,abc a2){if(a1.x==a2.x)return a1.y>a2.y;return a1.x<a2.x;}
const int mod=1e9+7;
int32_t main(){
        FAST;
        int n,x;
        cin>>n;
        map<int,int>mp;
        queue<int>q;
        for(int i=0;i<n;i++){cin>>x,q.push(x);}
        //while(!q.empty()){cout<<q.front()<<' ';q.pop();}
        for(int i=0;i<n;i++){
        	cin>>x;
        	int c=0;
        	if(mp[x]==1)c=0;
        	else {
        			while(1){
        			int p=q.front();
        			mp[p]++;
        			c++;
        			if(x==p){q.pop();break;}
        			q.pop();
        		}
        	}
        	//q.pop();
        	cout<<c<<' ';
        }
}


#include <bits/stdc++.h>
using namespace std;
#include<string.h>
#define ll long long int
#include<stack>
#include<set>

int main()
{
	ll n;
	cin>>n;
	ll a[n]={0},b[n]={0},j=0;
	for(ll i=0;i<n;i++)
	cin>>a[i];
	for(ll i=0;i<n;i++)
	cin>>b[i];
	for(ll i=0;i<n;i++)
	{
		if(a[i]==b[0])
		{
			j=i;
			break;
		}
	}
	cout<<j+1<<" ";
	for(ll i=1;i<n;i++)
	{
		ll flag=0;
		for(ll k=j+1;k<n;k++)
		{
			if(a[k]==b[i])
			{
				flag=1;
				cout<<k-j<<" ";
				j=k;
			}
		}
		if(flag==0)
		cout<<0<<" ";
	}
}


#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

int main()
{
    IOS;
    int n,x;
    cin>>n;
    int mark[n+5]={0};
    for(int i=1; i<=n; i++)
    {
        cin>>x;
        mark[x]=i;

    }
    int sum=0,y;
    for(int i=1; i<=n; i++)
    {
        cin>>y;
        if(mark[y])
        {
            if(mark[y]-sum>0)
            {
                cout<<mark[y]-sum<<" ";
                sum+=mark[y]-sum;
            }
            else
            {
                cout<<0<<" ";
                sum+=0;
            }
            mark[y]=0;
        }
        else
            cout<<"0 ";
    }

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

    int n,i,j,k,cnt=0,mx=0,x;
    scanf("%d",&n);
    int mark[n+5]={0};
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&x);
        mark[x]=i;

    }
    int sum=0,y;
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&y);
        if(mark[y])
        {
            if(mark[y]-sum>0)
            {
               // cout<<mark[y]-sum<<" ";
               printf("%d ",mark[y]-sum);
                sum+=mark[y]-sum;
            }
            else
            {
                //cout<<0<<" ";
                printf("0 ");
                sum+=0;
            }
            mark[y]=0;
        }
        else
            printf("0 ");
    }

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

    int n,i,j,k,cnt=0,mx=0,x;
    cin>>n;
    int mark[n+5]={0};
    for(int i=1; i<=n; i++)
    {
        cin>>x;
        mark[x]=i;

    }
    int sum=0,y;
    for(int i=1; i<=n; i++)
    {
        cin>>y;
        if(mark[y])
        {
            if(mark[y]-sum>0)
            {
                cout<<mark[y]-sum<<" ";
                sum+=mark[y]-sum;
            }
            else
            {
                cout<<0<<" ";
                sum+=0;
            }
            mark[y]=0;
        }
        else
            cout<<"0 ";
    }

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,i,j,k,cnt=0,mx=0,x;
    cin>>n;
    int mark[n+5]={0};
    for(int i=1; i<=n; i++)
    {
        cin>>x;
        mark[x]=i;

    }
    int sum=0,y;
    for(int i=1; i<=n; i++)
    {
        cin>>y;
        if(mark[y])
        {
            if(mark[y]-sum>0)
            {
                cout<<mark[y]-sum<<" ";
                sum+=mark[y]-sum;
            }
            else
            {
                cout<<0<<" ";
                sum+=0;
            }
            mark[y]=0;
        }
        else
            cout<<"0 ";
    }

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    freopen("input.txt","r",stdin);
    int n,i;
    cin>>n;
    int arr[n+5];
    for( i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    i=0;
    int y=n,x,cnt=0,flag,s;
    while(y--)
    {
        cnt=0;
        flag=1;
        cin>>x;
        for(;i<n;i++)
        {
            cnt++;
            if(arr[i]==x)
            {
                cout<<cnt<<" ";
                i++;
                cnt=0;
                s=i;
                flag=0;
                break;

            }
        }
        if(flag)
        {
            cout<<0<<" ";
            i=s;
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
   // freopen("input.txt","r",stdin);
    int n,i;
    cin>>n;
    int arr[n+5];
    for( i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    i=0;
    int y=n,x,cnt=0,flag,s;
    while(y--)
    {
        cnt=0;
        flag=1;
        cin>>x;
        for(;i<n;i++)
        {
            cnt++;
            if(arr[i]==x)
            {
                cout<<cnt<<" ";
                i++;
                cnt=0;
                s=i;
                flag=0;
                break;

            }
        }
        if(flag)
        {
            cout<<0<<" ";
            i=s;
        }

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    stack<int> st;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    for(int i=n-1;i>=0;--i)
        st.push(a[i]);
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;;
        while(st.size()){
            ++cnt;
            vis[st.top()]=true;
            if(st.top()==x){
                st.pop();
                break;
            }
            st.pop();
        }
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[300005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[a[last]]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        int cnt=0;
        while(last<n&&!vis[x]&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last;
        cout<<cnt+1<<" ";
    }
}


 #include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        int cnt=0;
        while(!vis[x]&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last;
        cout<<cnt+1<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n+5,0);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n+5,0);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        vis[x]=true;
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool vis[200005];
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;++i)
        cin >> a[i];
    int last=0,cnt=0;
    for(int i=0;i<n;++i){
        int x;
        cin >> x;
        if(vis[x]){cout<<"0 ";continue;}
        cnt=0;
        while(last<n&&a[last]!=x){
            ++cnt;
            vis[a[last]]=true;
            ++last;
        }
        ++last,++cnt;
        cout<<cnt<<" ";
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	long long n;
	cin >> n;

	vector<long long> A(n), B(n);

	for (long long i = 0; i < n; i++)
		cin >> A[i];
	for (long long i = 0; i < n; i++)
		cin >> B[i];

	auto it = A.begin();
	for (long long q : B)
	{
		it = find(A.begin(), A.end(), q);
		if (it == A.end())
		{
			cout << 0 << " ";
			continue;
		}

		it++;
		A.erase(A.begin(), it);

		cout << n - A.size() << " ";

		n = A.size();
	}
	cout << "\n";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;

	vector<int> A(n), B(n);

	for (int i = 0; i < n; i++)
		cin >> A[i];
	for (int i = 0; i < n; i++)
		cin >> B[i];

	auto it = A.begin();
	for (int q : B)
	{
		// cout << 18 << " ";
		it = find(A.begin(), A.end(), q);
		// cout << *it << "\n";
		if (it == A.end())
		{
			cout << 0 << " ";
			continue;
		}

		it++;
		A.erase(A.begin(), it);

		cout << n - A.size() << " ";

		n = A.size();
		// cout << "n:" << n << " ";

		// for (int x : A)
		// 	cout << x << " ";
	}
	cout << "\n";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n;
	cin >> n;

	vector<int> A(n), B(n);

	for (int i = 0; i < n; i++)
		cin >> A[i];
	for (int i = 0; i < n; i++)
		cin >> B[i];

	auto it = A.begin();
	for (int q : B)
	{
		it = find(A.begin(), A.end(), q);
		if (it == A.end())
		{
			cout << 0 << " ";
			continue;
		}

		it++;
		A.erase(A.begin(), it);

		cout << n - A.size() << " ";

		n = A.size();
	}
	cout << "\n";
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	long long n;
	cin >> n;

	vector<long long> A(n), B(n);

	for (long long i = 0; i < n; i++)
		cin >> A[i];
	for (long long i = 0; i < n; i++)
		cin >> B[i];

	vector<bool> X(n, false);
	long long position = 0;

	for (long long i = 0; i < n; i++)
	{
		long long y = B[i];
		if (X[y])
		{
			cout << 0 << " ";
			continue;
		}

		long long cnt = 0;
		while (true)
		{
			cnt++;
			X[A[position]] = true;

			if (A[position] == y)
				break;

			position++;
		}
		position++;
		cout << cnt << " ";
	}
	cout << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	long long n;
	cin >> n;

	vector<long long> A(n), B(n);

	for (long long i = 0; i < n; i++)
		cin >> A[i];
	for (long long i = 0; i < n; i++)
		cin >> B[i];

	vector<bool> X(n);
	int position = 0;

	for (int i = 0; i < n; i++)
	{
		int y = B[i];
		if (X[y])
		{
			cout << 0 << " ";
			continue;
		}

		int cnt = 0;
		while (true)
		{
			cnt++;
			X[A[position]] = true;

			if (A[position] == y)
				break;

			position++;
		}
		position++;
		cout << cnt << " ";
	}
	cout << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <climits>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n;
	cin >> n;

	vector<int> A(n), B(n);

	for (int i = 0; i < n; i++)
		cin >> A[i];
	for (int i = 0; i < n; i++)
		cin >> B[i];

	vector<bool> X(2e5, false);
	int position = 0;

	for (int i = 0; i < n; i++)
	{
		int y = B[i];
		if (X[y])
		{
			cout << 0 << " ";
			continue;
		}

		int cnt = 0;
		while (true)
		{
			cnt++;
			X[A[position]] = true;

			if (A[position] == y)
				break;

			position++;
		}
		position++;
		cout << cnt << " ";
	}
	cout << "\n";
	return 0;
}


#include <iostream>
#include <climits>
#include <cmath>
using namespace std;
int main()
{
	int T;
	long long n, x, y, d;
	cin >> T;

	while (T--)
	{
		cin >> n >> x >> y >> d;

		long long answer = abs(x - y), result = INT_MAX;

		if (answer % d == 0)
			result = min(result, answer / d);

		answer = y - 1;

		if (answer % d == 0)
			result = min(result, (long long)(ceil((x - 1) / float(d)) + answer / d));

		answer = n - y;

		if (answer % d == 0)
			result = min(result, (long long)(ceil((n - x) / float(d)) + answer / d));

		if (result == INT_MAX)
			result = -1;

		cout << result << "\n";
	}
}


#include <iostream>
#include <vector>
#include <climits>
using namespace std;
int N = 2e5 + 9;
vector<bool> X(N, false);
vector<int> A(N), B(N);
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n;
	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> A[i];
	for (int i = 0; i < n; i++)
		cin >> B[i];

	int position = 0;

	for (int i = 0; i < n; i++)
	{
		int y = B[i];
		if (X[y])
		{
			cout << 0 << " ";
			continue;
		}

		int cnt = 0;
		while (true)
		{
			cnt++;
			X[A[position]] = true;

			if (A[position] == y)
				break;

			position++;
		}
		position++;
		cout << cnt << " ";
	}
	cout << "\n";
	return 0;
}


#include <iostream>
#include <vector>
#include <climits>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n;
	cin >> n;

	vector<int> A(n), B(n);

	for (int i = 0; i < n; i++)
		cin >> A[i];
	for (int i = 0; i < n; i++)
		cin >> B[i];

	vector<bool> X(INT_MAX, false);
	int position = 0;

	for (int i = 0; i < n; i++)
	{
		int y = B[i];
		if (X[y])
		{
			cout << 0 << " ";
			continue;
		}

		int cnt = 0;
		while (true)
		{
			cnt++;
			X[A[position]] = true;

			if (A[position] == y)
				break;

			position++;
		}
		position++;
		cout << cnt << " ";
	}
	cout << "\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
long long int mas[1000001],n,mas1[1000001],k,c=0,d=0;
scanf("%lld",&n);
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&mas[i]);
  mas1[mas[i]]=1;
}
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&k);
  c=0;
  while(mas1[k]!=0&&d<n){
   mas1[mas[d]]--;
   d++;
   c++;
  }
  printf("%lld ",c);
}
return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
long long int mas[100001],n,mas1[100001],k,c=0,d=0;
scanf("%lld",&n);
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&mas[i]);
  mas1[mas[i]]=1;
}
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&k);
  c=0;
  while(mas1[k]!=0&&d<n){
   mas1[mas[d]]--;
   d++;
   c++;
  }
  printf("%lld ",c);
}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
int mas[100001],n,mas1[100001],k,c=0,d=0;

cin>>n;
for(int i=0;i<n;i++)
{
  cin>>mas[i];
  mas1[mas[i]]=1;
}
for(int i=0;i<n;i++)
{
  cin>>k;
  c=0;
  while(mas1[k]!=0&&d<n){
   mas1[mas[d]]=0;
   d++;
   c++;
  }
  cout<<c<<" ";
}
}


#include <bits/stdc++.h>
using namespace std;
int main(){
int mas[100001],n,mas1[100001],k,c=0,d=0;

cin>>n;
for(int i=0;i<n;i++)
{
cin>>mas[i];
mas1[mas[i]]=1;
}
for(int i=0;i<n;i++)
{
cin>>k;
c=0;

while(mas1[k]!=0&&d<n){
mas1[mas[d]]--;
d++;
c++;
}
cout<<c<<" ";
}

}


#include <bits/stdc++.h>
using namespace std;
int main(){
int mas[100001],n,mas1[100001],k,c=0,d=0;

cin>>n;
for(int i=0;i<n;i++)
{
cin>>mas[i];
mas1[mas[i]]=1;
}
for(int i=0;i<n;i++)
{
cin>>k;
c=0;

while(mas1[k]!=0){
mas1[mas[d]]--;
d++;
c++;
}
cout<<c<<" ";
}

}


#include <bits/stdc++.h>
using namespace std;
int main(){
long long int mas[100001],n,mas1[100001],k,c=0,d=0;
scanf("%lld",&n);
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&mas[i]);
  mas1[mas[i]]=1;
}
for(long long int i=0;i<n;i++)
{
  scanf("%lld",&k);
  c=0;
  while(mas1[k]!=0&&d<n){
   mas1[mas[d]]--;
   d++;
   c++;
  }
  printf("%lld ",c);
}
return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j;
	cin>>n;
	j=0;
	int a[n],b[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>b[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			for(;j<n;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j=0,i;
	cin>>n;
	int a[n],b[n];
	for ( i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>b[i];
	}
	for( i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			for(;;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j=0,i;
	cin>>n;
	int a[n],b[n];
	for ( i = 0; i < n; i++ )
	{
		a[i]=1;
		cin>>b[i];
	}
	for( i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1])
		{
			while(1)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
				j++;
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j=0;
	cin>>n;
	int a[n],b[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>b[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			for(;;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>
#include<stack>

using namespace std;

int main()
{
	int n,temp,p,count=0;
	stack <int> t,s;
	cin>>n;
	int a[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>temp;
		t.push(temp);
	}
	while(!t.empty())
	{
		s.push(t.top());
		t.pop();
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			do
			{
				p=s.top();
				s.pop();
				a[p-1]=0;
				count++;
			}while(temp!=p);
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j;
	cin>>n;
	j=0;
	int a[n],b[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>b[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			for(;;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>

using namespace std;

int main()
{
	int n,temp,count=0,j=0,i;
	cin>>n;
	int a[n],b[n];
	for ( i = 0; i < n; i++ )
	{
		a[i]=1;
		cin>>b[i];
	}
	for( i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1])
		{
			for(;;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>
#include<stack>

using namespace std;

int main()
{
	int n,temp,count=0,j;
	cin>>n;
	j=0;
	int a[n],b[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>b[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			for(;j<n;j++)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>
#include<stack>

using namespace std;

int main()
{
	int n,temp,p,count=0;
	stack <int> t,s;
	cin>>n;
	int a[n];
	for ( int i = 0; i < n; i += 1 )
	{
		a[i]=1;
		cin>>temp;
		t.push(temp);
	}
	while(!t.empty())
	{
		s.push(t.top());
		t.pop();
	}
	for(int i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1]!=0)
		{
			do
			{
				p=s.top();
				s.pop();
				a[p-1]=0;
				count++;
			}while((!s.empty())&&(temp!=p));
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include<iostream>
#include<vector>
#include<stdio.h>
using namespace std;
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main()
{
	fastio;
	int n,temp,count=0,j=0,i;
	cin>>n;
	vector<int> a(n),b(n);
	for ( i = 0; i < n; i++ )
	{
		a[i]=1;
		cin>>b[i];
	}
	for( i=0;i<n;i++)
	{
		cin>>temp;
		count=0;
		if(a[temp-1])
		{
			while(1)
			{
				a[b[j]-1]=0;
				count++;
				if(temp==b[j])
				{
					break;
				}
				j++;
			}
			j++;
		}
		cout<<count<<" ";
	}
	cout<<endl;
	return 0;
}


#include <iostream>
#include<string>
using namespace std;
const int N=2e5;
int tab[N],n,x,k;string s;
int main()
{
  cin>>n;
  for(int i=1;i<=n;i++)
  {
    cin>>x;
    tab[x]=i;
  }
  for(int i=0;i<n;i++)
  {
    cin>>x;
    int l=0;
    if(tab[x]>k)l=tab[x]-k,k=tab[x];
    s+=to_string(l)+" ";
  }
 cout<<s;

}


#include<stdio.h>
const int N=2e5;
int tab[N],n,x,k,l;
int main()
{ scanf("%d",&n);
  for(int i=1;i<=n;i++)
  {
   scanf("%d",&x);
    tab[x]=i;
  }
  for(int i=0;i<n;i++)
  {
    scanf("%d",&x);
    l=0;
    if(tab[x]>k)l=tab[x]-k,k=tab[x];
     printf("%d ",l);
  }

}