You are given a number $n$ and an array $b_1, b_2, \ldots, b_{n+2}$, obtained according to the following algorithm:

some array $a_1, a_2, \ldots, a_n$ was guessed;

array $a$ was written to array $b$, i.e. $b_i = a_i$ ($1 \le i \le n$);

The $(n+1)$-th element of the array $b$ is the sum of the numbers in the array $a$, i.e. $b_{n+1} = a_1+a_2+\ldots+a_n$;

The $(n+2)$-th element of the array $b$ was written some number $x$ ($1 \le x \le 10^9$), i.e. $b_{n+2} = x$; The

array $b$ was shuffled.

For example, the array $b=[2, 3, 7, 12 ,2]$ it could be obtained in the following ways:

$a=[2, 2, 3]$ and $x=12$;

$a=[3, 2, 7]$ and $x=2$.

For the given array $b$, find any array $a$ that could have been guessed initially.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^4$). Then $t$ test cases follow.

The first line of each test case contains a single integer $n$ ($1 \le n \le 2 \cdot 10^5$).

The second row of each test case contains $n+2$ integers $b_1, b_2, \ldots, b_{n+2}$ ($1 \le b_i \le 10^9$).

It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, output:

"-1", if the array $b$ could not be obtained from any array $a$;

$n$ integers $a_1, a_2, \ldots, a_n$, otherwise.

If there are several arrays of $a$, you can output any.


-----Examples-----

Input
4
3
2 3 7 12 2
4
9 1 7 1 6 5
5
18 2 2 3 2 9 2
3
2 6 9 2 1
Output
2 3 7 
-1
2 2 2 3 9 
1 2 6


-----Note-----

None

Source: codeforces | Difficulty: EASY
Tags: Greedy algorithms

Data structures

Constructive algorithms


Solutions:
I = lambda : [*map(int, input().split())]

def out(x):
	print(str(x))

def solve():
	n = I()
	b = I()
	ss = {}
	for i in b:
		xx = ss.setdefault(i, 0)
		ss[i] = xx + 1
	sm = sum(b)
	for i in b:
		ss[i] -= 1
		smx = sm - i
		if smx % 2 == 0:
			smx = smx // 2
			if ss.get(smx, -1) > 0:
				ss[smx] -= 1
				out(''.join([f'{k} ' * v for (k, v) in ss.items()]))
				return
		ss[i] += 1
	out(-1)
(t,) = I()
for i in range(t):
	solve()


for test in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	has = {}
	s = 0
	for val in b:
		s += val
		if val in has:
			has[val] += 1
		else:
			has[val] = 1
	ok = False
	for val in b:
		x = s - 2 * val
		has[val] -= 1
		if x in has and has[x] > 0:
			has[x] -= 1
			ok = True
			break
		has[val] += 1
	if ok == False:
		print('-1')
	else:
		for (key, values) in has.items():
			for j in range(values):
				print(key, end=' ')
		print()


class Solution:

	def solve(self, n, b):
		m = n + 2
		b.sort()
		summ = sum(b[:m - 1])
		largest = b[m - 1]
		largest2 = b[m - 2]
		for i in range(m - 1):
			if summ - b[i] == largest:
				return self.return_arr(i, b, 1, m)
		if summ - largest2 == largest2:
			return ' '.join([str(b[i]) for i in range(m - 2)])
		return -1

	def return_arr(self, i, b, k, m):
		return ' '.join([str(b[j]) for j in range(m - k) if j != i])
sol = Solution()
tests = int(input())
results = []
for _ in range(tests):
	n = int(input())
	b = list(map(int, input().split()))
	result = sol.solve(n, b)
	results.append(result)
for result in results:
	print(result)


import sys
from collections import Counter
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
for _ in range(INT()):
	(n, arr) = (INT(), ARR())
	d = Counter(arr)
	s = sum(arr)
	found = False
	for x in arr:
		y = s - x
		if y % 2 == 1:
			continue
		y = y // 2
		if y == x and d[x] == 1:
			continue
		if y in d:
			arr.remove(x)
			arr.remove(y)
			found = True
			break
	if found:
		print(JOIN(arr))
	else:
		print(-1)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import PriorityQueue as pq
for _ in range(int(input())):
	n = int(input())
	n += 2
	l = list(map(int, input().split()))
	l.sort()
	(x, y) = (-1, -1)
	f = 0
	(s1, s2) = (0, 0)
	for i in range(n - 1):
		if i == n - 2:
			s1 += l[i]
		else:
			s1 += l[i]
			s2 += l[i]
	for i in range(n - 1):
		if s1 - l[i] == l[-1]:
			x = n - 1
			y = i
			f = 1
			break
	if f == 0:
		y = n - 1
		if s2 == l[n - 2]:
			f = 1
			x = n - 2
	if f == 0:
		print(-1)
	else:
		p = [0] * (n - 2)
		c = 0
		for i in range(n):
			if i not in [x, y]:
				p[c] = l[i]
				c += 1
		print(*p)


def find_corrupt(arr):
	x = max(arr)
	s = sum(arr)
	arr.remove(x)
	for j in range(len(arr)):
		if 2 * x == s - arr[j]:
			arr.pop(j)
			return arr
	y = max(arr)
	if sum(arr) == 2 * y:
		arr.remove(y)
		return arr
	else:
		arr = [-1]
		return arr
t = int(input())
for i in range(t):
	n = int(input())
	ls = list(map(int, input().split()))
	print(' '.join(map(str, find_corrupt(ls))))


def main():
	from sys import stdin, stdout
	for _ in range(int(stdin.readline())):
		n = int(stdin.readline())
		arr = list(map(int, stdin.readline().split()))
		arrsum = sum(arr)
		mydict = {}
		for i in range(len(arr)):
			if arr[i] in mydict:
				mydict[arr[i]].append(i)
			else:
				mydict[arr[i]] = [i]
		flag = False
		(tempx, tempsum) = (None, None)
		for i in range(len(arr)):
			left = arrsum - arr[i]
			if left % 2 == 0 and len(mydict.get(left // 2, [])) and (arr[i] != left // 2 or (arr[i] == left // 2 and len(mydict[arr[i]]) > 1)):
				tempx = i
				tempsum = left // 2
				flag = True
		if flag:
			mydict[arr[tempx]] = mydict[arr[tempx]][1:]
			mydict[tempsum] = mydict[tempsum][1:]
			for i in mydict:
				for _ in range(len(mydict[i])):
					stdout.write(str(i) + ' ')
			stdout.write('\n')
		else:
			stdout.write('-1\n')
main()


t = int(input())
while t:
	t = t - 1
	n = int(input())
	a = input()
	l1 = a.split(' ')
	l = []
	for i in l1:
		l.append(int(i))
	l = l[0:n + 2]
	l = sorted(l)
	l1 = l[0:n - 1 + 2]
	s = sum(l1)
	f = 0
	for i in range(len(l1)):
		if s - l1[i] == l[n - 1 + 2]:
			f = 1
			break
	s = sum(l) - l[n - 1 + 2] - l[n]
	if s == l[n]:
		f = 1
	if f == 0:
		print(-1)
	else:
		if i == 0:
			l4 = l[1:n + 1]
		else:
			l4 = l[0:i] + l[i + 1:n + 1]
		l5 = []
		for i in l4:
			l5.append(str(i))
		print(' '.join(l5))


from bisect import bisect_left

def f(arr):
	b = None
	s = sum(arr)
	l = None
	arr = sorted(arr)
	for i in range(len(arr)):
		pt = bisect_left(arr, s - 2 * arr[i])
		if pt < len(arr) and pt >= 0 and (pt != i):
			if arr[pt] == s - 2 * arr[i]:
				l = pt
				b = i
	ans = []
	if b == None or l == None:
		return [-1]
	for i in range(len(arr)):
		if i == b or i == l:
			pass
		else:
			ans.append(arr[i])
	return ans
for i in range(int(input())):
	a = input()
	lst = list(map(int, input().strip().split()))
	print(*f(lst))


def find(x, sm):
	if sm % 2:
		return 0
	try:
		return cnt[sm // 2] > (x == sm // 2)
	except:
		return 0

def out(el, sm):
	t1 = t2 = 1
	for i in range(n + 2):
		if a[i] == sm and t1:
			t1 = 0
			continue
		elif a[i] == el and t2:
			t2 = 0
			continue
		else:
			print(a[i], end=' ')
	print()

def sol():
	global n, a, sum, cnt
	n = int(input())
	a = list(map(int, input().split()))
	a = list(sorted(a))
	sum = 0
	cnt = {}
	for i in range(n + 2):
		try:
			cnt[a[i]] += 1
		except:
			cnt[a[i]] = 1
		sum += a[i]
	for i in range(n + 2):
		if find(a[i], sum - a[i]):
			out(a[i], (sum - a[i]) // 2)
			return
	print(-1)
TN = int(input())
while TN != 0:
	sol()
	TN -= 1


from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import *
from random import *
input = stdin.readline
prin = stdout.write
from random import sample
from collections import Counter, deque
from fractions import *
from math import sqrt, ceil, log2, gcd, cos, pi
mod = 10 ** 9 + 7

def f(arr, i, j, d, dist):
	if i == j:
		return
	nn = max(arr[i:j])
	for tl in range(i, j):
		if arr[tl] == nn:
			dist[tl] = d
			f(arr, i, tl, d + 1, dist)
			f(arr, tl + 1, j, d + 1, dist)

def ps(n):
	cp = 0
	lk = 0
	arr = {}
	while n % 2 == 0:
		n = n // 2
		lk += 1
	for ps in range(3, ceil(sqrt(n)) + 1, 2):
		lk = 0
		cc = 0
		while n % ps == 0:
			n = n // ps
			lk += 1
	if n != 1:
		lk += 1
		return False
	return True

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

def factorials(n, r):
	slr = n
	dpr = r
	qlr = 1
	qs = 1
	mod = 10 ** 9 + 7
	for ip in range(n - r + 1, n + 1):
		qlr = qlr * ip % mod
	for ij in range(1, r + 1):
		qs = qs * ij % mod
	ans = qlr * modInverse(qs) % mod
	return ans

def modInverse(b):
	qr = 10 ** 9 + 7
	return pow(b, qr - 2, qr)
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def power(arr):
	listrep = arr
	subsets = []
	for i in range(2 ** len(listrep)):
		subset = []
		for k in range(len(listrep)):
			if i & 1 << k:
				subset.append(listrep[k])
		subsets.append(subset)
	return subsets

def pda(n):
	list = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				list.append(i)
			else:
				list.append(n // i)
				list.append(i)
	return list

def dis(xa, ya, xb, yb):
	return sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

def ii():
	return int(input())

def ilist():
	return [int(x) for x in input().strip().split()]

def islist():
	return list(map(str, input().split().rstrip()))

def inp():
	return input().strip()

def google(test, ans):
	return 'Case #' + str(test) + ': ' + str(ans)

def overlap(x1, y1, x2, y2):
	if x2 > y1:
		return y1 - x2
	if y1 > y2:
		return y2 - x2
	return y1 - x2

def pal(s):
	k = len(s)
	n = len(s) // 2
	for i in range(n):
		if s[i] == s[k - 1 - i]:
			continue
		else:
			return 0
	return 1

def dist(x1, y1, x2, y2):
	return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
t = int(input())
for p in range(t):
	n = ii()
	arr = ilist()
	arr.sort()
	sums = [0] * (n + 3)
	for i in range(1, n + 3):
		sums[i] = sums[i - 1] + arr[i - 1]
	ans = []
	cc = 0
	for j in range(n + 2):
		if j != n + 1:
			if sums[n + 2] - sums[n + 1] == sums[n + 1] - sums[j + 1] + sums[j]:
				for i in range(n + 2):
					if i != n + 1 and i != j:
						ans.append(arr[i])
				print(*ans)
				cc = 1
				break
		elif sums[n + 1] - sums[n] == sums[n]:
			print(*arr[:n])
			cc = 1
			break
	if cc == 0:
		print(-1)


t = int(input())
for k in range(t):
	n = int(input())
	m = list(map(int, input().split()))
	max_1 = max(m)
	i_m = m.index(max_1)
	s = sum(m)
	if 2 * max_1 >= s:
		m.pop(i_m)
		max_2 = max(m)
		i_m = m.index(max_2)
		if 2 * max_2 + max_1 == s:
			m.pop(i_m)
			print(*m)
		else:
			print(-1)
	else:
		m.pop(i_m)
		if s - 2 * max_1 in m:
			m.remove(s - 2 * max_1)
			print(*m)
		else:
			max_2 = max(m)
			i_m = m.index(max_2)
			if 2 * max_2 + max_1 == s:
				m.pop(i_m)
				print(*m)
			else:
				print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort(reverse=True)
	(maximum, secondMaximum) = (b[0], b[1])
	sumB = sum(b)
	if sumB - maximum * 2 in set(b[1:]):
		b.remove(maximum)
		b.remove(sumB - maximum * 2)
		print(*b)
		continue
	(b[0], b[1]) = (secondMaximum, maximum)
	if sumB - secondMaximum * 2 in set(b[1:]):
		b.remove(secondMaximum)
		b.remove(sumB - secondMaximum * 2)
		print(*b)
	else:
		print('-1')


t = int(input())
from collections import defaultdict
result = []
for i in range(t):
	n = int(input())
	b = [int(x) for x in input().strip().split(' ')]
	d = defaultdict(int)
	for num in b:
		d[num] += 1
	total = sum(b)
	solutions = None
	for key1 in d.keys():
		tmp = total - key1
		if tmp % 2 == 1:
			continue
		else:
			mid = tmp // 2
			if mid in d:
				if mid == key1 and d[key1] <= 1:
					continue
				else:
					solutions = (mid, key1)
		if solutions is not None:
			break
	if solutions is None:
		result.append(-1)
	else:
		tmp = ''
		for key in d.keys():
			if key == solutions[0] and key == solutions[1]:
				tmp += (str(key) + ' ') * (d[key] - 2)
			elif key in solutions:
				tmp += (str(key) + ' ') * (d[key] - 1)
			else:
				tmp += (str(key) + ' ') * d[key]
		result.append(tmp)
for line in result:
	print(line)


import sys
for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	found = False
	s = sum(b)
	for i in range(len(b)):
		if i == len(b) - 1:
			if len(b) >= 3 and (s - b[i]) % 2 == 0 and ((s - b[i]) // 2 == b[-2]):
				b.pop()
				b.pop()
				found = True
				print(*b)
			continue
		if (s - b[i]) % 2 == 0 and (s - b[i]) // 2 == b[-1]:
			b.pop(i)
			b.pop()
			found = True
			print(*b)
			break
	if not found:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	pre = [0] * (n + 2)
	for i in range(n + 2):
		pre[i] = b[i]
		if i - 1 >= 0:
			pre[i] += pre[i - 1]
	(d1, d2) = (-1, -1)
	for i in range(n + 2):
		if i < n + 1:
			if pre[n] - b[i] == b[n + 1]:
				d1 = i
				d2 = n + 1
				break
		elif b[n] == pre[n - 1]:
			d1 = n + 1
			d2 = n
			break
	if d1 == -1:
		print(-1)
		continue
	l = []
	for i in range(n + 2):
		if i != d1 and i != d2:
			l.append(b[i])
	print(*l)


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	s1 = sum(s) - s[-1] * 2
	if s1 in s[:-1]:
		s.remove(s1)
		print(*s[:n])
	else:
		print(*s[:n]) if sum(s[:n]) == s[n] else print('-1')


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	cnt = 0
	flg = 0
	for i in range(n + 2):
		cnt += b[i]
	for i in range(n + 1):
		if cnt - b[i] - b[-1] == b[-1]:
			for j in range(n + 1):
				if j != i:
					print(b[j], end=' ')
			print()
			flg = 1
			break
	if (cnt - b[-2] - b[-1] == b[-1] or cnt - b[-2] - b[-1] == b[-2]) and flg == 0:
		for i in range(n):
			print(b[i], end=' ')
		print()
		flg = 1
	if flg == 0:
		print(-1)


from collections import Counter, defaultdict
import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve(target_N, nums):
	total = 0
	vis = Counter(nums)
	(max_val, sec_max) = (-1, -1)
	nums.sort()
	(max_val, sec_max) = (nums[-1], nums[-2])
	total = sum(nums)
	vis[max_val] -= 1
	temp_total = total - max_val
	target = temp_total - max_val
	if target in vis and vis[target] > 0:
		ans = []
		vis[target] -= 1
		for v in vis:
			if vis[v] > 0:
				ans += [str(v)] * vis[v]
		return ' '.join(ans)
	vis[max_val] += 1
	vis[sec_max] -= 1
	temp_total = total - sec_max
	target = temp_total - sec_max
	if target in vis and vis[target] > 0:
		ans = []
		vis[target] -= 1
		for v in vis:
			if vis[v] > 0:
				ans += [str(v)] * vis[v]
		return ' '.join(ans)
	return -1
T = int(input())
for _ in range(T):
	target_N = int(input())
	nums = get_ints()
	print(solve(target_N, nums))


def question4():
	N = int(input())
	b_arr = list(map(int, input().split()))
	b_arr.sort()
	sum1 = b_arr[-1]
	k = sum(b_arr) - sum1
	for i in range(len(b_arr) - 1):
		if k - b_arr[i] == sum1:
			a = []
			for k in range(len(b_arr) - 1):
				if k != i:
					a.append(b_arr[k])
			return a
	sum1 = b_arr[-2]
	k = 0
	for i in range(len(b_arr) - 1):
		if i != len(b_arr) - 2:
			k += b_arr[i]
	if sum1 == k:
		a = []
		for k in range(len(b_arr) - 1):
			if k != len(b_arr) - 2:
				a.append(b_arr[k])
		return a
	return -1
remained_test_cases = int(input())
while remained_test_cases > 0:
	a1 = question4()
	if a1 == -1:
		print(-1)
	else:
		print(*a1)
	remained_test_cases -= 1


for _ in range(int(input())):
	n = int(input()) + 2
	lis = sorted(map(int, input().split()))
	s = sum(lis)
	ind = -1
	for i in range(n - 1):
		if s - lis[-1] - lis[i] == lis[-1]:
			ind = i
			break
	if ind != -1:
		for i in range(n - 1):
			if i != ind:
				print(lis[i], end=' ')
		print()
	elif s - lis[-1] - lis[-2] != lis[-2]:
		print(-1)
	else:
		print(*lis[:-2])


for i in range(int(input())):
	int(input())
	b = [int(x) for x in input().split()]
	x1 = b.pop(b.index(max(b)))
	test = sum(b) - x1
	if test in b:
		b.remove(test)
		print(*b)
	else:
		x2 = b.pop(b.index(max(b)))
		b.append(x1)
		test = sum(b) - x2
		if test in b:
			b.remove(test)
			print(*b)
		else:
			print(-1)


t = int(input())
for t in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	c = l.copy()
	c.sort()
	m1 = c[-1]
	m2 = c[-2]
	c = c[:-2]
	s = sum(c)
	d = 0
	for i in range(len(c)):
		if s == m1 or s == m2:
			d = 1
			print(*c)
			break
		elif s + m1 - c[i] == m2:
			d = 1
			c[i] = m1
			print(*c)
			break
		elif s + m2 - c[i] == m1:
			d = 1
			c[i] = m2
			print(*c)
			break
	if d == 0:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	arr = [int(w) for w in input().split(' ')]
	arr.sort()
	s = 0
	for i in range(n + 2):
		s = s + arr[i]
	s1 = s - arr[-1]
	s2 = s1 - arr[-2]
	if s2 == arr[-2]:
		res = arr[:n]
	else:
		flag = 0
		for item in arr[:n + 1]:
			x = s1 - item
			if x == arr[-1]:
				arr.remove(item)
				flag = 1
				break
		if flag == 0:
			res = -1
		else:
			res = []
			for item in arr[:n]:
				res.append(item)
	if res == -1:
		print(-1)
	else:
		for item in res:
			print(item, end=' ')
		print('')


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
import bisect, string, math, time, functools, random, fractions
from bisect import *
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def I():
	return int(input())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def AI():
	return map(int, open(0).read().split())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def NLI(n):
	return [[int(i) for i in input().split()] for i in range(n)]

def NLI_(n):
	return [[int(i) - 1 for i in input().split()] for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def INP():
	N = 10
	n = random.randint(1, N)
	a = RLI(n, 0, n - 1)
	return (n, a)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		a1 = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print(inp)
			print('naive', a1)
			print('solve', a2)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

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

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
alp = [chr(ord('a') + i) for i in range(26)]

def gcj(c, x):
	print('Case #{0}:'.format(c + 1), x)

def primeFactor(N):
	(i, n) = (2, N)
	ret = {}
	(d, sq) = (2, 99)
	while i <= sq:
		k = 0
		while n % i == 0:
			(n, k, ret[i]) = (n // i, k + 1, k + 1)
		if k > 0 or i == 97:
			sq = int(n ** (1 / 2) + 0.5)
		if i < 4:
			i = i * 2 - 1
		else:
			(i, d) = (i + d, d ^ 6)
	if n > 1:
		ret[n] = 1
	return ret

def divisor(n):
	div = [1]
	for (i, j) in primeFactor(n).items():
		div = [i ** k * d for d in div for k in range(j + 1)]
	return div

def PrimeNumSet(N):
	M = int(N ** 0.5)
	seachList = [i for i in range(2, N + 1)]
	primes = []
	while seachList:
		if seachList[0] > M:
			break
		primes.append(seachList[0])
		tmp = seachList[0]
		seachList = [i for i in seachList if i % tmp != 0]
	return primes + seachList

def LCM(b, mo=10 ** 9 + 7):
	prs = PrimeNumSet(max(b))
	M = dict(zip(prs, [0] * len(prs)))
	for i in b:
		dc = primeFactor(i)
		for (j, k) in dc.items():
			M[j] = max(M[j], k)
	r = 1
	for (j, k) in M.items():
		if k != 0:
			r *= pow(j, k, mo)
			r %= mo
	return r

def extgcd(x, y):
	if y == 0:
		return (1, 0)
	(r0, r1, s0, s1) = (x, y, 1, 0)
	while r1 != 0:
		(r0, r1, s0, s1) = (r1, r0 % r1, s1, s0 - r0 // r1 * s1)
	return (s0, (r0 - s0 * x) // y, x * s0 + y * (r0 - s0 * x) // y)

def crt(rems, mods):
	n = len(rems)
	if n != len(mods):
		return NotImplemented
	(x, d) = (0, 1)
	for (r, m) in zip(rems, mods):
		(a, b, g) = extgcd(d, m)
		(x, d) = ((m * b * x + d * a * r) // g, d * (m // g))
		x %= d
	for (r, m) in zip(rems, mods):
		if r != x % m:
			return (-1, d)
	return (x, d)

def intsqrt(x):
	if x < 0:
		return NotImplemented
	rt = int(x ** 0.5) - 1
	while (rt + 1) ** 2 <= x:
		rt += 1
	return rt

class Comb:

	def __init__(self, n, mo=10 ** 9 + 7):
		self.fac = [0] * (n + 1)
		self.inv = [1] * (n + 1)
		self.fac[0] = 1
		self.fact(n)
		for i in range(1, n + 1):
			self.fac[i] = i * self.fac[i - 1] % mo
			self.inv[n] *= i
			self.inv[n] %= mo
		self.inv[n] = pow(self.inv[n], mo - 2, mo)
		for i in range(1, n):
			self.inv[n - i] = self.inv[n - i + 1] * (n - i + 1) % mo
		return

	def fact(self, n):
		return self.fac[n]

	def invf(self, n):
		return self.inv[n]

	def comb(self, x, y):
		if y < 0 or y > x:
			return 0
		return self.fac[x] * self.inv[x - y] * self.inv[y] % mo

	def cat(self, x):
		if x < 0:
			return 0
		return self.fac[2 * x] * self.inv[x] * self.inv[x + 1] % mo
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	n = I()
	b = sorted(LI())[::-1]
	orb = b[:]
	s = sum(b[1:])
	(x, y) = b[:2]
	if s - x in b[1:]:
		b.remove(s - x)
		print(*b[1:])
	elif y == s - y:
		print(*b[2:])
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())), reverse=True)
	sm = sum(l)
	ans = 0
	for i in range(2):
		for j in range(n + 2):
			if i != j and sm - 2 * l[i] == l[j]:
				if i > j:
					del l[i]
					del l[j]
				else:
					del l[j]
					del l[i]
				ans = 1
				break
		if ans:
			break
	if ans == 0:
		print(-1)
	else:
		print(*l)


import math
from collections import defaultdict
from sys import stdout
DEBUG = True

def log(*args, **kwargs):
	if DEBUG:
		print(*args, **kwargs)

def ri():
	return int(input())

def rl(f=int):
	return list(map(f, input().split()))

def rs():
	return input()

class Solution:

	def __init__(self):
		pass

	def run(self):
		n = ri()
		b = rl()
		d = defaultdict(int)
		for x in b:
			d[x] += 1
		total = sum(b)
		for x in b:
			s = (total - x) / 2
			if d[s] > 0 and (s != x or d[s] > 1):
				d[s] -= 1
				d[x] -= 1
				result = []
				for (k, v) in d.items():
					if v > 0:
						result.extend([str(k) for i in range(v)])
				return ' '.join(result)
		return -1
t = int(input())
s = Solution()
for i in range(t):
	print(s.run())


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	r = sum(A) - 2 * A[-1]
	if r in A[:-1]:
		A.remove(r)
		A.pop()
		print(*A)
	else:
		A.pop()
		if sum(A[:-1]) == A[-1]:
			A.pop()
			print(*A)
		else:
			print(-1)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	n += 2
	pref = [0 for _ in range(n)]
	pref[0] = arr[0]
	for k in range(1, n):
		pref[k] += arr[k] + pref[k - 1]
	if pref[n - 3] == arr[n - 2]:
		print(*arr[:n - 2])
	elif pref[n - 2] > arr[n - 1] and pref[n - 2] - arr[n - 1] in arr[:n - 1]:
		res = arr[:n - 1]
		res.remove(pref[n - 2] - arr[n - 1])
		print(*res)
	else:
		print('-1')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	t = sum(l)
	if t - l[-1] - l[-2] == l[-2]:
		print(*l[:-2])
	else:
		t -= l[-1]
		f = 0
		for i in range(n + 1):
			if t - l[i] == l[-1]:
				f = 1
				break
		if f == 1:
			for j in range(n + 1):
				if j != i:
					print(l[j], end=' ')
			print()
		else:
			print(-1)


for _ in range(int(input())):
	x = int(input())
	lis = list(map(int, input().split()))
	lis.sort()
	if sum(lis[:x]) > lis[-1]:
		print(-1)
		continue
	done = False
	new = lis.copy()
	sum1 = sum(lis[:len(lis) - 1])
	if sum1 - lis[-1] in lis:
		new.remove(sum1 - lis[-1])
		new.pop()
		done = True
	elif sum(lis[:-2]) == lis[-1] or sum(lis[:-2]) == lis[-2]:
		new = new[:len(lis) - 2]
		done = True
	if not done:
		print(-1)
	else:
		string = ''
		for i in new:
			string += str(i) + ' '
		print(string)


t = int(input())
while t > 0:
	n = int(input())
	b = sorted(list(map(int, input().split())))
	s = sum(b)
	if s - 2 * b[-1] in b[:-1]:
		b.remove(s - 2 * b[-1])
		print(*b[:-1])
	elif sum(b[:-2]) == b[-2]:
		print(*b[:-2])
	else:
		print(-1)
	t -= 1


import os
import sys
from io import BytesIO, IOBase
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')
for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	s = sum(l) - l[-1]
	f = 0
	x = -1
	for i in range(n + 1):
		if s - l[i] == l[-1]:
			f = 1
			x = i
			break
	if f:
		l.pop(x)
		print(*l[:n])
		continue
	if s == 2 * l[-2]:
		print(*l[:n])
		continue
	print(-1)


for t in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	s = sum(b[:-2])
	if sum(b[:-2]) == b[-2]:
		print(*b[:-2])
	else:
		s += b[-2]
		ans = [-1]
		for i in range(n + 1):
			if s - b[i] == b[-1]:
				ans = b[:i] + b[i + 1:-1]
		print(*ans)


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	s = sum(arr[:-2])
	if s == arr[-2]:
		print(*arr[:-2])
		continue
	s += arr[-2]
	ans = [-1]
	for i in range(n + 1):
		if s - arr[i] == arr[-1]:
			ans = arr[:i] + arr[i + 1:-1]
			break
	print(*ans)


def main():
	for _ in range(int(input())):
		a = input()
		b = list(map(int, input().split(' ')))
		print(get(b))

def get(mas):
	a = sum(mas)
	res = []
	for i in sorted(mas, reverse=True)[0:2]:
		c = 0
		for b in mas:
			if i == b:
				c += 1
			if (i != b or c > 1) and i == a - b - i:
				f = i
				x = b
				mas.remove(i)
				mas.remove(b)
				return ' '.join(list(map(str, sorted(mas))))
	return -1
main()


t = int(input())
for i in range(t):
	n = int(input())
	n = n + 2
	l = list(map(int, input().split()))
	l.sort()
	s1 = 0
	s2 = 0
	for j in range(n - 2):
		s1 = s1 + l[j]
		s2 = s2 + l[j]
	s1 = s1 + l[n - 2]
	if s2 == l[n - 2]:
		for j in range(n - 2):
			print(l[j], end=' ')
	else:
		a = s1 - l[n - 1]
		if a in l[0:n - 1]:
			c = 0
			for j in range(n - 1):
				if l[j] == a:
					if c == 1:
						print(l[j], end=' ')
					c = 1
				else:
					print(l[j], end=' ')
		else:
			print('-1', end='')
	print()


from sys import stdin, stdout
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
from collections import defaultdict as dd, Counter as C, deque
from math import ceil, gcd, sqrt, factorial
from itertools import permutations
for _ in range(it()):
	n = it()
	n += 2
	l = sorted(mp())
	ts = sum(l)
	su = l[-1]
	ts -= su
	flag = 0
	for i in range(n - 1):
		if ts - l[i] == su:
			x = i
			flag = 1
			break
	if flag:
		for i in range(n - 1):
			if i != x:
				print(l[i], end=' ')
		print()
		continue
	ts = sum(l[:-2])
	if l[-2] == ts:
		print(*l[:-2])
	else:
		print(-1)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	n = iinp()
	arr = lmp()
	arr.sort()
	sm = sum(arr[:n + 1])
	flg = False
	for i in range(n + 1):
		if i < n and sm - arr[i] == arr[-1] or (i == n and sm - arr[i] in [arr[-1], arr[-2]]):
			flg = True
			break
	if flg:
		for j in range(n + 1):
			if j == i:
				continue
			print(arr[j], end=' ')
		print()
	else:
		print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	dummyList = []
	dummyList = list(map(int, input().split()))
	dummyList.sort()
	listsum = sum(dummyList)
	total = listsum - dummyList[n + 1]
	carry = dummyList[n + 1]
	del dummyList[n + 1]
	if total - carry in dummyList:
		dummyList.remove(total - carry)
		print(*dummyList)
	else:
		dummyList.insert(n + 1, carry)
		if listsum - dummyList[n] - dummyList[n + 1] == dummyList[n]:
			del dummyList[n + 1]
			del dummyList[n]
			print(*dummyList)
		else:
			print(-1)


def max_list(int_list):
	max = 0
	second_max = 0
	sum = 0
	for i in range(len(int_list)):
		sum = sum + int_list[i]
		if int_list[i] > max:
			second_max = max
			max = int_list[i]
		elif int_list[i] > second_max:
			second_max = int_list[i]
	return (max, second_max, sum)

def count_element(elem, l):
	counter = 0
	for i in range(len(l)):
		if l[i] == elem:
			counter = counter + 1
	return counter
t = int(input())
for i in range(t):
	flag = 0
	n = int(input())
	list_A = list(map(int, input().strip().split(' ')))
	(max, second, sum) = max_list(list_A)
	first_candidate = sum - max
	second_candidate = sum - second
	num1 = first_candidate - max
	num2 = second_candidate - second
	if num1 in list_A and (num1 != max or count_element(num1, list_A) > 1) and (flag == 0):
		list_A.remove(num1)
		list_A.remove(max)
		flag = 1
	if num2 in list_A and (num2 != second or count_element(num2, list_A) > 1) and (flag == 0):
		list_A.remove(num2)
		list_A.remove(second)
		flag = 1
	if flag == 1:
		for i in range(len(list_A)):
			print(list_A[i], end=' ')
		print()
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if sum(a[:n]) == a[n]:
		print(*a[:n])
		continue
	s = sum(a[:n + 1])
	for i in range(n + 1):
		if s - a[i] == a[-1]:
			print(*a[:i], *a[i + 1:-1])
			break
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	nums = [int(x) for x in input().split(' ')]
	m = max(nums)
	m_i = nums.index(m)
	nums[m_i] = 0
	flag = False
	s = sum(nums)
	for i in range(len(nums)):
		if nums[i] and s - nums[i] == m:
			nums[i] = 0
			print(' '.join((str(x) for x in nums if x > 0)))
			flag = True
			break
	if flag:
		continue
	m = max(nums)
	m_i = nums.index(m)
	nums[m_i] = 0
	if s - m == m:
		print(' '.join((str(x) for x in nums if x > 0)))
	else:
		print(-1)


def solve(n, b):
	d = {}
	for i in range(n + 2):
		d[b[i]] = d.get(b[i], 0) + 1
	s = sum(b)
	k = -1
	x = -1
	for i in range(n + 2):
		p = s - b[i]
		x = p - b[i]
		o = d.get(x, 0)
		if x == b[i] and o >= 2:
			k = i
			break
		if x != b[i] and o >= 1:
			k = i
			break
	if k == -1:
		return -1
	a = []
	for i in range(n + 2):
		if i != k and b[i] == x:
			x = -1
			continue
		if i != k:
			a.append(b[i])
	return ' '.join(map(str, a))
t = int(input())
while t > 0:
	n = int(input())
	b = list(map(int, input().split()))
	print(solve(n, b))
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	sumn = sum(l[0:n + 1])
	flag = 0
	for i in range(n + 1):
		tem = sumn - l[i]
		if tem == l[-1]:
			ll = []
			for j in range(n + 1):
				if j == i:
					continue
				ll.append(l[j])
			print(*ll)
			flag = 1
			break
	if flag == 0 and sumn - l[-2] == l[-2]:
		print(*l[0:n])
	elif flag == 0:
		print(-1)


for i in range(int(input())):
	a = int(input())
	b = [int(x) for x in input().split()]
	flag = False
	x = max(b)
	b.remove(max(b))
	test = sum(b) - x
	if test in b:
		b.remove(test)
		print(*sorted(b))
	else:
		y = max(b)
		b.remove(max(b))
		b.append(x)
		test = sum(b) - y
		if test in b:
			b.remove(test)
			print(*sorted(b))
		else:
			print(-1)


r = lambda : list(map(int, input().split()))
t = int(input())
for _ in range(t):
	n = int(input())
	arr = r()
	brr = sorted(arr)
	s = sum(arr)
	x = s
	f = False
	val = brr[-1]
	brr.remove(val)
	s -= val
	for i in brr:
		if s - i == val:
			f = True
			imp = i
			brr.remove(imp)
			print(*brr)
			break
	if not f:
		s += val
		brr.append(val)
		val = brr[-2]
		brr.remove(val)
		s -= val
		for i in brr:
			if s - i == val:
				f = True
				imp = i
				brr.remove(imp)
				print(*brr)
				break
	if not f:
		print(-1)


t = int(input())
while t:
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	(b1, b2) = (a[-1], a[-2])
	somatorio = sum(a)
	if somatorio - b1 == 2 * b2:
		a = [str(x) for x in a[:n]]
		print(' '.join(a))
	else:
		for i in range(n + 1):
			if somatorio - a[i] == 2 * b1:
				b = a[:i] + a[i + 1:n + 1]
				b = [str(x) for x in b[:n]]
				print(' '.join(b))
				break
		else:
			print('-1')
	t -= 1


import heapq
t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	b = list(map(int, input().strip().split()))
	sum_b = sum(b)
	(max_b, smax_b) = heapq.nlargest(2, b)
	cur_max = max_b
	for x in b:
		if x == max_b:
			cur_max = smax_b
		else:
			cur_max = max_b
		cur_sum = sum_b - cur_max - x
		if cur_sum == cur_max:
			break
	if cur_sum != cur_max:
		print(-1)
		continue
	b.pop(b.index(cur_max))
	b.pop(b.index(x))
	print(' '.join(map(str, b)))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	x = sorted(a)
	last = x.pop()
	sl = x.pop()
	s = sum(x)
	if s == last or s == sl:
		print(*x)
		continue
	elif s + sl <= last:
		print('-1')
		continue
	elif s > last:
		print('-1')
		continue
	elif s + sl > last:
		f = False
		check = s + sl
		for i in range(len(x)):
			if check - x[i] == last:
				x.pop(i)
				print(*x, sl)
				f = True
				break
		if not f:
			print('-1')
	else:
		print('-1')


import math

def solve():
	n = int(input())
	b = list(map(int, input().split()))
	m = n + 2
	a_sum = max(b)
	prefix_sum = [0] * m
	b.sort()
	for i in range(1, m):
		prefix_sum[i] = prefix_sum[i - 1] + b[i - 1]
	for i in range(m - 1):
		left_sum = prefix_sum[i] - prefix_sum[0]
		right_sum = prefix_sum[-1] - prefix_sum[i + 1]
		if left_sum + right_sum == a_sum:
			return ' '.join(map(str, b[:i] + b[i + 1:m - 1]))
	if b[-2] == prefix_sum[-2] - prefix_sum[0]:
		return ' '.join(map(str, b[:-2]))
	return -1
t = int(input())
while t > 0:
	t -= 1
	print(solve())


t = int(input())
for _ in range(t):
	N = int(input())
	nums = list(map(int, input().split()))
	nums = sorted(nums)
	(n1, n2) = (nums[-1], nums[-2])
	total = sum(nums)
	found = False
	for n in nums[:-1]:
		if total - n == 2 * n1:
			nums.remove(n)
			t = total - n
			nums.remove(t // 2)
			print(' '.join((str(i) for i in nums)))
			found = True
			break
	else:
		for n in nums[::-2] + [nums[-1]]:
			if total - n == 2 * n2:
				nums.remove(n)
				t = total - n
				nums.remove(t // 2)
				print(' '.join((str(i) for i in nums)))
				found = True
				break
	if found == False:
		print(-1)


for tt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	sm = sum(l)
	op1 = l[-1]
	op1sm = sm - op1
	found = False
	val = -1
	for i in range(n + 1):
		if op1sm - l[i] == op1:
			val = i
			found = True
			break
	if found:
		print(*l[0:val], *l[val + 1:n + 1])
		continue
	elif sm - l[-2] - l[-1] == l[-2]:
		print(*l[0:n])
	else:
		print(-1)


import sys
input = sys.stdin.readline
for nt in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if sum(a[:-2]) == a[-1] or sum(a[:-2]) == a[-2]:
		print(*a[:-2])
		continue
	if sum(a[:-1]) - a[-1] in a[:-1]:
		x = a[:-1].index(sum(a[:-1]) - a[-1])
		print(*a[0:x] + a[x + 1:-1])
		continue
	print(-1)


t = int(input())

def deleteonetime(b, x):
	r = b[:]
	for i in range(len(r)):
		if r[i] == x:
			return r[:i] + r[i + 1:]
	return r

def rep(b, n):
	S = sum(b)
	dico = {}
	for y in b:
		if not 2 * y in dico:
			dico[2 * y] = 1
		else:
			dico[2 * y] += 1
	for x in b:
		if S - x in dico and (dico[S - x] > 1 or x != (S - x) // 2):
			a = b[:]
			y = (S - x) // 2
			a = deleteonetime(a, y)
			return deleteonetime(a, x)
	return [-1]
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(' '.join(map(str, rep(sorted(a), n))))


from collections import Counter
t = int(input())

def solve(b):
	total = sum(b)
	c = Counter(b)
	for x in b:
		c.subtract([x])
		if total - x & 1 == 0 and c[total - x >> 1] > 0:
			c.subtract([total - x >> 1])
			return list(c.elements())
		c.update([x])
	return []
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	ans = solve(b)
	if len(ans) > 0:
		print(*ans, sep=' ')
	else:
		print(-1)


import math
import sys
import collections
import bisect
import time
import itertools

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(input())):
	n = int(input())
	arr = get_list()
	counter = collections.Counter(arr)
	val = sum(arr)
	pos = []
	for i in range(n + 2):
		x = arr[i]
		temp_sum = val - x
		half_sum = temp_sum / 2
		if half_sum in counter:
			if half_sum == x and counter[x] >= 2:
				pos = [x, x]
				break
			elif half_sum != x:
				pos = [half_sum, x]
				break
	if len(pos) == 0:
		print(-1)
		continue
	else:
		for i in pos:
			arr.remove(i)
		print(*arr)


def check_n_plus_1_candidate(candidate, b_tuple):
	b_list_without_cand = list(b_tuple)
	b_list_without_cand.remove(candidate)
	b_sum = sum(b_list_without_cand)
	for b in b_list_without_cand:
		if b_sum - b == candidate:
			b_list_without_cand.remove(b)
			return b_list_without_cand
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	b_tuple = tuple((int(b) for b in input().split()))
	n_plus_1_candidates = sorted(b_tuple, reverse=True)[:2]
	res = []
	a_collection_is_possible = False
	for cand in n_plus_1_candidates:
		potential_res = check_n_plus_1_candidate(cand, b_tuple)
		if potential_res:
			print(' '.join(map(str, potential_res)))
			a_collection_is_possible = True
			break
	if not a_collection_is_possible:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(sorted([int(x) for x in input().split()]))
	arr = list(reversed(arr))
	ans = False
	res = []
	m = arr.pop(0)
	s = sum(arr)
	for i in range(n + 1):
		x = s - arr[i]
		if x > m:
			break
		elif x == m:
			ans = True
			res = list(map(str, arr))
			res.pop(i)
			break
	if not ans:
		res = []
		m = arr.pop(0)
		if sum(arr) == m:
			ans = True
			res = list(map(str, arr))
	if ans:
		print(' '.join(res))
	else:
		print(-1)


def solve(s):
	n = len(s) - 2
	s = list(sorted(s))
	total = sum(s[:n + 1])
	res = []
	for i in range(n + 1):
		if total - s[i] == s[n + 1]:
			for j in range(n + 1):
				if j == i:
					continue
				res.append(s[j])
			return res
	total = sum(s[:n])
	if total == s[n]:
		return s[:n]
	return '-1'
tt = int(input())
for _ in range(tt):
	n = int(input())
	s = list(map(int, input().split(' ')))
	res = solve(s)
	if res == '-1':
		print(res)
	else:
		print(' '.join(map(str, res)))


def main():
	t = int(input())
	allans = []
	for _ in range(t):
		n = int(input())
		b = readIntArr()
		b.sort()
		largest = b[n + 1]
		secondLargest = b[n]
		if sum(b[:n]) == secondLargest:
			ans = b[:n]
			allans.append(ans)
			continue
		others = sum(b[:n + 1])
		x = others - largest
		if x in b[:n + 1]:
			ans = b
			ans.remove(largest)
			ans.remove(x)
			allans.append(ans)
		else:
			allans.append([-1])
	multiLineArrayOfArraysPrint(allans)
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultVal, dimensionArr):
	dv = defaultVal
	da = dimensionArr
	if len(da) == 1:
		return [dv for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(x, y):
	print('? {} {}'.format(x, y))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(ans))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


case = int(input())
for c in range(case):
	length = int(input())
	myList = list(map(int, input().split()))
	myList.sort()
	val = sum(myList[:length])
	if val == myList[length]:
		for i in range(length):
			print(myList[i], end=' ')
		print()
	elif myList[length + 1] - (myList[length] + val) < 0 and abs(myList[length + 1] - (myList[length] + val)) in myList and (abs(myList[length + 1] - (myList[length] + val)) != myList[length + 1]):
		myList.remove(abs(myList[length + 1] - (myList[length] + val)))
		for i in range(length):
			print(myList[i], end=' ')
		print()
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(s) for s in input().split(' ')]
	a.sort()
	lst = a.pop()
	tot = sum(a)
	if tot > lst:
		diff = tot - lst
		if diff in a:
			a.remove(diff)
			print(' '.join(map(str, a)))
		else:
			lst = a.pop()
			tot -= lst
			if lst == tot:
				print(' '.join(map(str, a)))
			else:
				print(-1)
	else:
		lst = a.pop()
		tot -= lst
		if lst == tot:
			print(' '.join(map(str, a)))
		else:
			print(-1)


import sys
input = sys.stdin.readline
from collections import Counter
t = int(input())
for tests in range(t):
	n = int(input())
	B = list(map(int, input().split()))
	SUM = sum(B)
	C = Counter(B)
	D = Counter(B)
	for c in C:
		if (SUM - c) % 2 == 1:
			continue
		x = (SUM - c) // 2
		if x == c:
			if C[c] >= 2:
				D[c] -= 2
				ANS = []
				for d in D:
					for j in range(D[d]):
						ANS.append(d)
				print(*ANS)
				break
		elif C[x] >= 1:
			D[x] -= 1
			D[c] -= 1
			ANS = []
			for d in D:
				for j in range(D[d]):
					ANS.append(d)
			print(*ANS)
			break
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	t = max(b)
	i = b.index(t)
	s = sum(b) - t
	for j in range(n + 2):
		if j != i and s - b[j] == t:
			print(*(b[k] for k in range(n + 2) if k != i and k != j))
			break
	else:
		b = b[:i] + b[i + 1:]
		t = max(b)
		if sum(b) == t * 2:
			i = b.index(t)
			print(*b[:i], *b[i + 1:])
		else:
			print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	b = [int(x) for x in input().split()]
	b.sort()
	temp = sum(b[:n])
	if b[n] == temp or b[n + 1] == temp:
		b = [str(x) for x in b]
		print(' '.join(b[:n]))
		continue
	temp = sum(b[:n + 1])
	flag = False
	for i in range(n):
		temp1 = temp - b[i]
		if temp1 == b[n + 1]:
			flag = True
			b.pop(i)
			break
	if flag:
		b = [str(x) for x in b]
		print(' '.join(b[:n]))
	else:
		print(-1)


def f(b):
	b.sort()
	bsum = sum(b)
	candidat1 = b[-1]
	x = bsum - 2 * candidat1
	if x in b[:-1]:
		b.remove(x)
		b.remove(candidat1)
		return ' '.join(map(str, b))
	candidat2 = b[-2]
	x = bsum - 2 * candidat2
	if x in b[:-2] or x == candidat1:
		b.remove(x)
		b.remove(candidat2)
		return ' '.join(map(str, b))
	return -1
for kT in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	print(f(b))


def solve():
	n = int(input())
	b = list(map(int, input().split()))
	ans = []
	t = 0
	d = {}
	for x in b:
		t += x
		d[x] = d.get(x, 0) + 1
	for x in b:
		z = t - x
		if z % 2 == 0 and d.get(z // 2, 0) > 0:
			if z // 2 == x:
				if d[x] > 1:
					ans = b.copy()
					ans.remove(x)
					ans.remove(z // 2)
					break
			else:
				ans = b.copy()
				ans.remove(x)
				ans.remove(z // 2)
				break
	if ans:
		print(' '.join([str(x) for x in ans]))
	else:
		print(-1)
for _ in range(int(input())):
	solve()


def helper(pool):
	pool.sort()
	s = sum(pool)
	if s - pool[-1] * 2 in pool[:-1]:
		pool.remove(s - pool[-1] * 2)
		return pool[:-1]
	elif s - pool[-1] == pool[-2] * 2:
		return pool[:-2]
	return []
t = int(input())
for i in range(t):
	n = int(input())
	pool = list(map(int, input().split(' ')))
	res = helper(pool)
	if not res:
		print('-1')
	else:
		print(' '.join(list(map(str, res))))


for z in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ma = a[0]
	mai = 0
	for i in range(n + 2):
		if a[i] > ma:
			ma = a[i]
			mai = i
	su = sum(a) - ma
	fl = 0
	i2 = -1
	for i in range(n + 2):
		if i != mai and su - a[i] == ma:
			fl = 1
			i2 = i
			break
	if fl == 0:
		a.remove(ma)
		ma2 = a[0]
		ma2i = 0
		for i in range(n + 1):
			if a[i] > ma2:
				ma2 = a[i]
				ma2i = i
		if sum(a) - ma2 == ma2:
			for i in range(n + 1):
				if i != ma2i:
					print(a[i], end=' ')
			print()
		else:
			print(-1)
	else:
		for i in range(n + 2):
			if i != i2 and i != mai:
				print(a[i], end=' ')
		print()


for _ in range(int(input())):
	n = int(input())
	n += 2
	b = list(map(int, input().split()))
	b = sorted(b)
	s = b[-1]
	s1 = 0
	isum = n - 1
	x = 0
	for i in range(n - 1):
		s1 += b[i]
	for i in range(n - 1):
		temp = s1 - b[i]
		if temp == s:
			x = i
			break
	else:
		s = b[-2]
		s2 = 0
		isum = n - 2
		for j in range(n - 2):
			s2 += b[j]
		if s2 == s:
			x = n - 1
		else:
			x = -1
	a = []
	for i in range(n):
		if x == -1:
			print(-1)
			break
		if i == x or i == isum:
			continue
		else:
			a.append(b[i])
	else:
		for i in range(len(a)):
			print(a[i], end=' ')
		print()


import sys
import math as mt
import collections as cc
import itertools as it
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	ar = I()
	ar.sort()
	ans = []
	su = sum(ar)
	for i in [len(ar) - 1, len(ar) - 2]:
		tar = ar[i]
		now = su - tar
		for j in range(len(ar)):
			if j != i:
				if now - ar[j] == tar:
					ans.append([i, j])
	if ans:
		for i in range(len(ar)):
			if i not in ans[0]:
				print(ar[i], end=' ')
		print()
	else:
		print(-1)


for w in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b = sorted(b)
	ans = 0
	m = n + 2
	x = b[m - 1]
	a = []
	temp_sum = 0
	for i in range(m - 1):
		temp_sum += b[i]
	for i in range(m - 1):
		if temp_sum - b[i] == x:
			ans = 1
			for j in range(m - 1):
				if j != i:
					a.append(b[j])
			break
	if ans == 0:
		temp_sum_2 = 0
		for i in range(m - 2):
			temp_sum_2 += b[i]
		if b[-2] == temp_sum_2:
			ans = 1
			for i in range(m - 2):
				a.append(b[i])
	if ans == 0:
		print(-1)
	else:
		for i in range(n):
			print(a[i], end=' ')
		print()


def corruptedArray(n, array):
	a = array.copy()
	m = max(a)
	s = sum(a)
	sef = s - m
	el = sef - m
	a.remove(m)
	if el in a:
		a.remove(el)
		return a
	else:
		b = array.copy()
		el = max(b)
		b.remove(el)
		s = sum(b)
		if s // 2 != s / 2:
			return [-1]
		m = s // 2
		if m in b:
			b.remove(m)
			return b
		else:
			return [-1]
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	ans = corruptedArray(n, l)
	for i in ans:
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	a.reverse()
	sumA = sum(a[1:])
	sumA2 = sum(a[2:])
	checker = False
	checker2 = False
	for k in range(1, len(a)):
		if sumA - a[k] == a[0]:
			res = a[1:k] + a[k + 1:]
			res.sort()
			checker = True
			break
	if checker:
		ausgabe = ''
		for k in res:
			ausgabe += str(k) + ' '
		print(ausgabe)
	elif sumA2 == a[1]:
		res = a[2:]
		res.sort()
		ausgabe = ''
		for k in res:
			ausgabe += str(k) + ' '
		print(ausgabe)
	else:
		print(-1)


for tc in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	s = sum(a)
	if s - 2 * a[-1] in a[:-1]:
		a.remove(s - 2 * a[-1])
		print(' '.join((str(i) for i in a[:-1])))
	elif sum(a[:-2]) == a[-2]:
		print(' '.join([str(i) for i in a[:-2]]))
	else:
		print(-1)


t = int(input())
while t:
	t -= 1
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	s = sum(b[:-2])
	if b[-2] == s:
		print(*b[:-2])
	else:
		s = sum(b[:-1])
		flag = True
		for i in range(len(b) - 1):
			if s - b[i] == b[-1]:
				flag = False
				for j in range(len(b) - 1):
					if j == i:
						continue
					print(b[j], end=' ')
				print()
				break
		if flag:
			print(-1)


for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	x = b[-1]
	b = b[:n + 1]
	sb = sum(b)
	if sb == 2 * b[-1]:
		print(*b[:n], sep=' ')
	else:
		flag = 0
		for i in range(n + 1):
			if x == sb - b[i]:
				b = b[:i] + b[i + 1:]
				flag = 1
				break
		if flag == 1:
			print(*b, sep=' ')
		else:
			print(-1)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict, Counter, deque
from itertools import combinations
import heapq
sys.setrecursionlimit(100000000)
mod = 1000000007
for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	s1 = sum(s) - s[-1] * 2
	if s1 in s[:-1]:
		s.remove(s1)
		print(*s[:n])
	else:
		print(*s[:n]) if sum(s[:n]) == s[n] else print('-1')


def b(d, t, l, h):
	if l > h:
		return None
	else:
		mid = int((l + h) / 2)
		if d[mid] == t:
			return mid
		elif d[mid] > t:
			return b(d, t, l, mid - 1)
		else:
			return b(d, t, mid + 1, h)
for _ in range(int(input())):
	n = int(input())
	l = sorted(map(int, input().split()))
	t = sum(l)
	for i in range(n + 2):
		p = t - l[i]
		if p % 2 == 0:
			j = int(p / 2)
			k = b(l, j, 0, n + 1)
			if k and k != i:
				for a in range(n + 2):
					if a != i and a != k:
						print(l[a], end=' ')
				print()
				n = -1
				break
	if n != -1:
		print(-1)


def count_numbers(original_array):
	count = {}
	for i in original_array:
		if i in count:
			count[i] += 1
		else:
			count[i] = 1
	return count

def find_original_array(input_array):
	sorted_arr = sorted(input_array)
	counted_dict = count_numbers(sorted_arr)
	max_value = sorted_arr[-1]
	pre_max_value = sorted_arr[-2]
	sum_with_remainder = sum(sorted_arr[0:-1])
	remainder = sum_with_remainder - max_value
	if remainder in counted_dict and remainder != max_value:
		sorted_arr.remove(sum_with_remainder - max_value)
		sorted_arr.remove(max_value)
		return ' '.join(map(str, sorted_arr))
	elif sum(sorted_arr[0:-2]) == sorted_arr[-2]:
		sorted_arr.remove(max_value)
		sorted_arr.remove(pre_max_value)
		return ' '.join(map(str, sorted_arr))
	else:
		return '-1'

def solve():
	number_of_tests = int(input())
	for test in range(number_of_tests):
		size = int(input())
		input_array = list(map(int, input().split(' ')))
		print(find_original_array(input_array))
solve()


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	b = sum(a) - 2 * a[-1]
	if b in a[:-1]:
		x = a[:-1]
		x.remove(b)
		print(*x)
	elif sum(a[:n]) == a[n]:
		print(*a[:n])
	else:
		print(-1)


for _ in range(int(input())):
	n = int(int(input()))
	a = list(map(int, input().split()))
	b = a.copy()
	b.sort()
	x = b[-1]
	pos = a.index(x)
	tot = sum(a) - x
	found = False
	for i in range(len(a)):
		if i != pos:
			if tot - a[i] == x:
				y = a[i]
				pos2 = i
				found = True
	if found == True:
		ans = []
		for i in range(len(a)):
			if i != pos and i != pos2:
				ans.append(a[i])
		print(*ans)
	else:
		x = b[-2]
		pos = a.index(x)
		tot = sum(a) - x
		found = False
		for i in range(len(a)):
			if i != pos:
				if tot - a[i] == x:
					y = a[i]
					pos2 = i
					found = True
		if found == True:
			ans = []
			for i in range(len(a)):
				if i != pos and i != pos2:
					ans.append(a[i])
			print(*ans)
		else:
			print(-1)


t = int(input())
for i in range(t):
	n = int(input())
	b = [int(x) for x in input().split()]
	(m, p) = (b[0], 0)
	sm = sum(b)
	for j in range(1, n + 2):
		if b[j] > m:
			m = b[j]
			p = j
	b = b[:p] + b[p + 1:]
	f = False
	for x in b:
		if x + 2 * m == sm:
			f = True
			break
	if f:
		b.remove(x)
		print(' '.join((str(y) for y in b)))
	else:
		for x in b:
			if m + 2 * x == sm:
				b.remove(x)
				print(' '.join((str(y) for y in b)))
				break
		else:
			print(-1)


import sys
from collections import Counter
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
	ntc = next(ints)
	for tc in range(1, ntc + 1):
		n = next(ints)
		b = [next(ints) for i in range(n + 2)]
		cnt = Counter(b)
		total = sum(b)

		def cond(i):
			s = total - b[i]
			return s % 2 == 0 and cnt.get(s // 2, 0) - (2 * b[i] == s) > 0
		xi = next((i for i in range(n + 2) if cond(i)), -1)
		if xi == -1:
			print('-1')
		else:
			print(*sorted(b[:xi] + b[xi + 1:])[:-1])
	return
main()


import sys
for _ in range(int(input())):
	n = int(input())
	x = [int(n) for n in input().split()]
	x.sort()
	xsum = 0
	lo = 0
	for i in range(n):
		xsum += x[i]
	if xsum == x[n]:
		print(*x[0:n])
		continue
	else:
		xsum += x[n]
		for i in range(n + 1):
			if xsum - x[i] == x[n + 1]:
				for j in range(n + 1):
					if i != j:
						print(x[j], end=' ')
				lo = 1
				print()
				break
	if lo != 1:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	lis = list(map(int, input().split()))
	m = max(lis)
	m_i = lis.index(m)
	del lis[m_i]
	s = sum(lis)
	if s % 2 == 0 and s == max(lis) * 2:
		s_m = max(lis)
		s_m_i = lis.index(s_m)
		del lis[s_m_i]
		lis.sort()
		print(*lis)
	else:
		f = 0
		for i in range(len(lis)):
			if s - lis[i] == m:
				del lis[i]
				lis.sort()
				print(*lis)
				f = 1
				break
		if f == 0:
			print(-1)


for t in range(int(input())):
	n = int(input())
	b = [int(x) for x in input().split()]
	b.sort()
	flag = False
	assumed_sum = b[-2]
	total = sum(b) - assumed_sum - b[-1]
	if total == assumed_sum:
		b.pop()
		b.pop()
		print(*b)
		continue
	assumed_sum = b[-1]
	total = sum(b) - assumed_sum
	b.pop(n + 1)
	for i in range(n + 1):
		if total - b[i] == assumed_sum:
			b.pop(i)
			flag = True
			break
	if flag:
		print(*b)
		continue
	else:
		print(-1)


t = int(input())
while t != 0:
	t = t - 1
	n = int(input())
	list1 = list(map(int, input().split(' ')))
	list1.sort()
	c = 0
	sum1 = sum(list1)
	if sum(list1[:-2]) == list1[-2] or sum(list1[:-2]) == list1[-1]:
		for j in range(len(list1) - 2):
			print(list1[j], end=' ')
		print()
	else:
		for i in range(len(list1) - 1):
			ele = sum1 - list1[i] - list1[-1]
			if ele == list1[-1]:
				c = 1
				list1.remove(list1[i])
				list1.remove(list1[-1])
				for j in range(len(list1)):
					print(list1[j], end=' ')
				print()
				break
		if c == 0:
			print(-1)


for _ in range(int(input())):
	n = int(input())
	l = list(sorted(map(int, input().split())))
	n += 2
	l1 = l[:n - 1]
	s = sum(l1)
	if s == 2 * l1[-1]:
		l1.pop(n - 2)
		print(*(i for i in l1))
	else:
		k = s - l[-1]
		if k in l1:
			l1.remove(k)
			print(*(i for i in l1))
		else:
			print(-1)


import sys
input = sys.stdin.readline

def solve(a, n):
	a.sort(reverse=True)
	mx = a[0]
	sm = sum(a[1:])
	c = []
	ind = 0
	for i in range(1, n):
		if mx == sm - a[i]:
			ind = i
			for j in range(1, n):
				if j != ind:
					print(a[j], end=' ')
			print('')
			return
	mx = a[1]
	if mx == sum(a[2:]):
		print(*a[2:])
		return
	print(-1)
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	solve(a, n + 2)


import os
import sys
from io import BytesIO, IOBase
_print = print
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 inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())
from collections import Counter

class Multiset(Counter):

	def __init__(self, iterable):
		super().__init__(iterable)

	def discard(self, element, num=1):
		self[element] -= num
		if self[element] <= 0:
			del self[element]

	def add(self, element):
		self[element] += 1

	def __ior__(self, iterable):
		for element in iterable:
			self[element] += 1

	def __iadd__(self, other):
		for (key, value) in other.items():
			self[key] += value

	def __isub__(self, other):
		for (key, value) in other.items():
			self.discard(key, value)

def solve():
	n = itg()
	st = Multiset(mpint())
	s = sum(st.elements())
	ans = [-1]
	for num in st:
		st.discard(num)
		s -= num
		b = s - num
		if b in st:
			st.discard(b)
			ans = st.elements()
			break
		st.add(num)
		s += num
	return ans

def main():
	for _ in range(itg()):
		print(*solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1512/problem/D'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 2:
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG:

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


for _ in range(int(input())):
	n = int(input())
	arrB = list(map(int, input().split()))
	arrB.sort()
	sumB = sum(arrB)
	for i in range(n + 2):
		if i != n + 1:
			if sumB - arrB[i] == 2 * arrB[n + 1]:
				print(*arrB[:i] + arrB[i + 1:n + 1])
				break
		elif sumB - arrB[n + 1] == 2 * arrB[n]:
			print(*arrB[:n])
			break
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	n = n + 1 + 1
	arr = list(map(int, input().split()))
	t = sum(arr)
	dic = {}
	flag = 1
	for i in range(n):
		if arr[i] in dic:
			dic[arr[i]] += 1
		else:
			dic[arr[i]] = 1
	for i in range(n):
		if (t - arr[i]) / 2 in dic:
			if (t - arr[i]) / 2 == arr[i]:
				if dic[(t - arr[i]) / 2] < 1 + 1:
					continue
			q = arr[i]
			e = (t - arr[i]) // 2
			arr.remove(q)
			arr.remove(e)
			flag = 0
			break
	if flag:
		print(-1)
	else:
		for i in range(len(arr)):
			print(arr[i], end=' ')
		print()


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
t = int(input())
for _ in range(t):
	n = int(input())
	b = get_ints()
	s = sum(b)
	b.sort()
	(m1, m2) = (b[-1], b[-2])
	s = s - m1
	f = -1
	for i in range(n + 1):
		if s - b[i] == m1:
			f = i
			break
	a = []
	if f != -1:
		a = []
		for i in range(n + 1):
			if i != f:
				a.append(b[i])
	else:
		s = s - m2
		if s == m2:
			a = b[:n]
	if len(a):
		sys.stdout.write(' '.join(map(str, a)) + '\n')
	else:
		print(-1)


for _ in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	a.sort()
	s = sum(a[:n])
	if s == a[n] or s == a[n + 1]:
		print(*a[:n], sep=' ')
	else:
		f = 0
		for i in range(n - 1, -1, -1):
			x = a[n] - a[i]
			if s + x == a[n + 1]:
				a[i] = a[n]
				f = 1
				break
		if f:
			print(*a[:n], sep=' ')
		else:
			print(-1)


import math, sys
from collections import defaultdict, deque
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

def I():
	return int(sys.stdin.readline())

def In():
	return map(int, sys.stdin.readline().split())

def Sn():
	return sys.stdin.readline().strip()

def Pr(x):
	sys.stdout.write(str(x) + '\n')

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def index(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def find_gte(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		l = list(In())
		l.sort()
		total = sum(l)
		temp = -1
		pos = -1
		for i in range(n + 2):
			if (total - l[i]) % 2 == 0:
				temp = index(l, (total - l[i]) // 2)
				if temp != -1 and temp != i:
					pos = i
					break
		if pos == -1:
			print(-1)
			return
		mx = (total - l[pos]) // 2
		ans = []
		for i in range(n + 2):
			if i == pos:
				continue
			elif mx == l[i]:
				mx = -1
			else:
				ans.append(l[i])
		print(*ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


def get_a(b, n):
	b = sorted(b)
	largest = b[-1]
	sec_largest = b[-2]
	corrupt_plus_sum_a = sum(b[:-1])
	corrupt = -1
	for i in range(n + 1):
		if corrupt_plus_sum_a - b[i] == largest:
			corrupt = i
			return ' '.join([str(b[i]) for i in range(len(b) - 1) if i != corrupt])
	if sum(b[:-2]) == sec_largest:
		corrupt = len(b) - 1
		return ' '.join([str(b[i]) for i in range(len(b) - 2)])
	else:
		return -1
t = int(input())
while t:
	n = int(input())
	b = list(map(int, input().split()))
	a = get_a(b, n)
	print(a)
	t -= 1


import sys, math
import heapq
from collections import deque
input = sys.stdin.readline

def ip():
	return int(input())

def fp():
	return float(input())

def sp():
	return str(input().rstrip())

def mip():
	return map(int, input().split())

def msp():
	return map(str, input().split())

def lmip():
	return list(map(int, input().split()))

def lmsp():
	return list(map(str, input().split()))

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

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

def isprime(x):
	if x == 1:
		return False
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
	return True

def find(x):
	if x == p[x]:
		return x
	q = find(p[x])
	p[x] = q
	return q

def union(x, y):
	global n
	x = find(x)
	y = find(y)
	if x != y:
		p[y] = x
t = ip()
while t:
	t -= 1
	n = ip()
	b = lmip()
	b.sort()
	sp = sum(b)
	sum1 = sp - b[-1]
	tr = -1
	for i in range(n + 1):
		if sum1 - b[i] == b[-1]:
			tr = i
			break
	if tr < 0:
		if sum(b[:-2]) == b[-2]:
			for i in range(n):
				print(b[i], end=' ')
			print()
			continue
		print(-1)
		continue
	for i in range(n + 1):
		if tr == i:
			continue
		print(b[i], end=' ')
	print()


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	data = list(map(int, sys.stdin.readline().split()))
	data.sort()
	x = sum(data) - data[-1] * 2
	if x in data[:len(data) - 1]:
		data.remove(x)
		print(*data[:n])
	elif sum(data[:n]) == data[n]:
		print(*data[:n])
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	s = b[-1]
	t = sum(b[:-1])
	f = 0
	c = -1
	for i in range(n + 1):
		if t - b[i] != s:
			continue
		c = b[i]
		f = 1
		break
	ans = []
	if f:
		f1 = 0
		for i in range(n + 1):
			if b[i] == c and f1 == 0:
				f1 = 1
			else:
				ans.append(b[i])
		print(*ans)
		continue
	if sum(b[:-2]) == b[-2]:
		ans = b[:-2]
		print(*ans)
		continue
	print(-1)


import os
import sys
from io import BytesIO, IOBase
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))

def scanf(datatype=str):
	return datatype(sys.stdin.readline().rstrip())

def printf(answer=''):
	return sys.stdout.write(str(answer) + '\n')

def prints(answer):
	return sys.stdout.write(str(answer) + ' ')

def map_input(datatype=str):
	return map(datatype, sys.stdin.readline().split())

def list_input(datatype=str):
	return list(map(datatype, sys.stdin.readline().split()))

def testcase(number: int, solve_function):
	for i in range(number):
		printf(solve_function())

def solve():
	n = scanf(int)
	arr = list_input(int)
	arr.sort()
	ans = sum(arr) - 2 * arr[-1]
	if ans in arr[:-1]:
		arr.remove(ans)
		return ' '.join(map(str, arr[:n]))
	elif sum(arr[:n]) == arr[n]:
		return ' '.join(map(str, arr[:n]))
	else:
		return -1
t = scanf(int)
testcase(t, solve)


from __future__ import division, print_function
import os
import 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 main():
	pass
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):
	(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')
main()
for _ in range(int(input())):
	n = int(input())
	n += 2
	b = list(map(int, input().split()))
	s = sum(b)
	a = [0] * (n - 2)
	b.sort()
	f = 0
	for i in range(n - 1):
		c = s - b[-1]
		c = c - b[i]
		if c == b[-1]:
			k = i
			f = 1
			break
	if f == 0:
		if s - b[-1] - b[-2] == b[-2]:
			print(*b[:-2])
		else:
			print(-1)
	else:
		print(*b[:i], *b[i + 1:n - 1])


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	if sum(l[:-2]) == l[-2]:
		print(*l[:-2])
	elif sum(l[:-1]) - l[-1] in l:
		a = l.index(sum(l[:-1]) - l[-1])
		if a == n + 1:
			print(-1)
		else:
			l.pop(a)
			print(*l[:-1])
	else:
		print(-1)


t = int(input())
for _ in range(t):
	n = int(input())
	b = sorted(list(map(int, input().split())))
	largest_element = b[-1]
	second_largest_element = b[-2]
	b_sum = sum(b) - largest_element
	if second_largest_element == b_sum - second_largest_element:
		print(*b[:len(b) - 2])
	else:
		successful = False
		for i in b[:len(b) - 1]:
			sum_without_element = b_sum - i
			if largest_element == sum_without_element:
				b.remove(i)
				successful = True
				break
		if successful:
			print(*b[:len(b) - 1])
		else:
			print(-1)


list1 = []
for i in range(int(input())):
	n = int(input())
	s = list(map(lambda x: int(x), input().split()))
	k = sum(s) - 2 * max(s)
	if k in s:
		s.remove(k)
		if 2 * max(s) == sum(s):
			s.remove(max(s))
			list1.append(' '.join(list(map(lambda x: str(x), s))))
		else:
			list1.append(-1)
	else:
		s.remove(max(s))
		if 2 * max(s) == sum(s):
			s.remove(max(s))
			list1.append(' '.join(list(map(lambda x: str(x), s))))
		else:
			list1.append(-1)
print(*list1, sep='\n')


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	ans = [0] * (n + 2)
	ans[0] = a[0]
	for i in range(1, n + 2):
		ans[i] = ans[i - 1] + a[i]
	j = -1
	for i in range(n + 2):
		if n + 1 != i:
			if a[n + 1] == ans[n] - a[i]:
				j = i
				break
		elif ans[n] == 2 * ans[n - 1]:
			j = i
			break
	if j == -1:
		print(j)
	else:
		if n + 1 != j:
			pp = n + 1
		else:
			pp = n
		k = [a[i] for i in range(pp) if i != j]
		print(*k)


t = int(input())
for inh in range(0, t):
	n = int(input())
	b = list(map(int, input().split()))
	mAx = max(b)
	s = sum(b) - mAx
	c = False
	b.remove(mAx)
	for i in range(0, len(b)):
		if s - b[i] == mAx:
			c = True
			x = mAx
			y = b[i]
			break
	if c:
		b.remove(y)
		print(*b)
	else:
		mAx = max(b)
		s = sum(b) - mAx
		if s == mAx:
			b.remove(mAx)
			print(*b)
		else:
			print(-1)


import sys
input = sys.stdin.readline
I = lambda : map(int, input().split())
for _ in [0] * int(input()):
	n = int(input()) + 2
	b = list(I())
	b = sorted(b)
	ss = sum(b)
	x = ss - 2 * b[n - 1]
	a = b[:n - 1]
	if x in a:
		a.remove(x)
		print(*a)
	else:
		x = ss - 2 * b[n - 2]
		a = b[:n - 2] + [b[n - 1]]
		if x in a:
			a.remove(x)
			print(*a)
		else:
			print(-1)


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	n += 2
	l = list(map(int, input().split()))
	l.sort()
	k = sum(l[0:n - 1])
	if n == 1 or n == 2:
		print(*l)
	else:
		t = -1
		for i in range(n - 1):
			k -= l[i]
			if k == l[-1]:
				t = i
				break
			if i == n - 2:
				if k == l[-2]:
					t = i
					break
			k += l[i]
		if t != -1:
			for i in range(n - 1):
				if i != t:
					print(l[i], end=' ')
			print()
		else:
			print(-1)


t = int(input())
for x in range(t):
	new_lst = []
	length = int(input())
	lst = [int(a) for a in input().split()]
	a = max(lst)
	lst.remove(a)
	total = sum(lst)
	z = total - a
	if z in lst:
		lst.remove(z)
		for j in lst:
			new_lst.append(str(j))
		print(' '.join(new_lst))
	else:
		a = max(lst)
		lst.remove(a)
		if sum(lst) == a:
			for j in lst:
				new_lst.append(str(j))
			print(' '.join(new_lst))
		else:
			print(-1)


import os
import sys
from io import BytesIO, IOBase
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')
from math import ceil

def prod(a, mod=10 ** 9 + 7):
	ans = 1
	for each in a:
		ans = ans * each % mod
	return ans

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

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	total = sum(a)
	sa = {}
	for i in a:
		if i not in sa:
			sa[i] = 0
		sa[i] += 1
	pos = False
	for i in sa:
		x = total - 2 * i
		if x in sa:
			if x == i:
				if sa[x] < 2:
					continue
			pos = True
			break
	if not pos:
		print(-1)
		continue
	a.remove(i)
	a.remove(x)
	print(*a)


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	b = [int(x) for x in input().split()]
	b = sorted(b)
	max1 = b[-1]
	max2 = b[-2]
	s = sum(b[:-1])
	p = -1
	for i in range(n + 1):
		if s - b[i] == max1:
			p = i
			break
	if p != -1:
		a = []
		for i in range(n + 1):
			if i != p:
				a.append(b[i])
		print(*a)
		continue
	if sum(b[:n]) == max2:
		print(*b[:n])
		continue
	print(-1)


from sys import stdin, stdout
import sys
import math
import itertools
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)

def solve(arr):
	g = max(arr)
	maxi = arr.index(g)
	m = set()
	summation = sum(arr) - g
	for i in arr:
		m.add(i)
	ans = -1
	for i in range(len(arr)):
		if i != maxi and summation - arr[i] == g:
			ans = (g, arr[i])
			break
	for i in range(len(arr)):
		if i != maxi and summation - arr[i] == arr[i]:
			ans = (arr[i], g)
			break
	return ans

def main():
	t = int(stdin.readline().strip())
	for i in range(1, t + 1):
		n = int(stdin.readline().strip())
		arr = [int(x) for x in stdin.readline().split()]
		ans = solve(arr)
		if ans == -1:
			stdout.write('-1\n')
		else:
			flag1 = flag2 = 0
			for j in arr:
				if j == ans[0] and flag1 == 0:
					flag1 = 1
					continue
				if j == ans[1] and flag2 == 0:
					flag2 = 1
					continue
				print(j, end=' ')
			print()
main()


def main():
	for _ in range(int(input())):
		n = int(input())
		b = list(map(int, input().split()))
		sb = sum(b)
		b.sort(reverse=True)
		success = False
		if b[1] == (sb - b[0]) // 2 and (sb - b[0]) % 2 == 0:
			print(*b[2:])
			success = True
		else:
			sb -= b[0]
			for x in range(1, len(b)):
				if sb - b[x] == b[0]:
					b.pop(x)
					print(*b[1:])
					success = True
					break
		if not success:
			print(-1)
main()


def check(arr, ele, idx):
	sum_arr = s - ele
	ans = [0, False]
	for i in range(idx):
		if sum_arr - arr[i] == ele:
			ans[1] = True
			ans[0] = arr[:i] + arr[i + 1:idx]
			break
	return ans
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	s = sum(a)
	ans1 = check(a, a[-1], n + 1)
	if ans1[1] == True:
		print(*ans1[0])
		continue
	ans2 = sum(a[:-2])
	if ans2 == a[-2]:
		print(*a[:-2])
	else:
		print(-1)


t = int(input())
for k in range(t):
	n = int(input())
	b = sorted(list(map(int, input().split())))
	if sum(b[:-2]) == b[-2]:
		print(*b[:-2])
		continue
	else:
		summ = sum(b[:-1])
		if summ - b[-1] in b[:-1]:
			flag = False
			for elem in b[:-1]:
				if elem == summ - b[-1]:
					if flag:
						print(elem, end=' ')
					else:
						flag = True
				else:
					print(elem, end=' ')
			print()
			continue
		else:
			print(-1)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	lis = list(map(int, input().split()))
	(l1, l2) = (0, 0)
	for i in lis[:]:
		if i > l1:
			l2 = l1
			l1 = i
		elif i > l2:
			l2 = i
	s = sum(lis) - l1
	checker = lis.copy()
	checker.remove(l1)
	if s - l1 in checker:
		lis.remove(l1)
		lis.remove(s - l1)
		print(*lis)
		return
	s = sum(lis) - l2
	checker = lis.copy()
	checker.remove(l2)
	if s - l2 in checker:
		lis.remove(l2)
		lis.remove(s - l2)
		print(*lis)
		return
	else:
		print('-1')
for _ in range(int(input())):
	solve()


import sys
from collections import Counter

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def spr(A):
	s = sum(A)
	czek = Counter(A)
	for liczba in A:
		druga = (s - liczba) / 2
		if liczba == druga:
			if czek[liczba] > 1:
				A.remove(liczba)
				A.remove(druga)
				A = list(map(str, A))
				return ' '.join(A)
		elif czek[druga] > 0:
			A.remove(liczba)
			A.remove(druga)
			A = list(map(str, A))
			return ' '.join(A)
	return -1

def main():
	for i in range(int(input())):
		n = int(input())
		print(spr(get_ints()))
main()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	maxa = max(arr)
	arr.remove(maxa)
	suma = sum(arr)
	for i in range(n + 1):
		if suma - arr[i] == maxa:
			arr.remove(arr[i])
			print(*arr)
			break
	else:
		maxa = max(arr)
		arr.remove(maxa)
		suma = sum(arr)
		if suma == maxa:
			print(*arr)
		else:
			print('-1')


from itertools import combinations
for _ in range(int(input())):
	n = int(input())
	data = list(map(int, input().split()))
	plus = sum(data)
	data.sort()
	m = data.pop()
	haveAns = False
	for i in data:
		if plus - i == 2 * m:
			haveAns = True
			data.pop(data.index(i))
			break
	if haveAns == False:
		data.insert(0, m)
		m = data.pop()
		for i in data:
			if plus - i == 2 * m:
				haveAns = True
				data.pop(data.index(i))
				break
	if haveAns:
		data.sort()
		print(' '.join(map(str, data)))
	else:
		print(-1)


def corruptedArray(l):
	lm = max(l)
	lmi = l.index(lm)
	d = l[:lmi] + l[lmi + 1:]
	ls = sum(d)
	x = ls - lm
	try:
		z = d.index(x)
	except:
		dm = max(d)
		dmi = d.index(dm)
		g = d[:dmi] + d[dmi + 1:]
		ds = sum(g)
		if ds == dm:
			list_string = list(map(str, g))
			return ' '.join(list_string)
		else:
			return '-1'
	h = d[:z] + d[z + 1:]
	list_string = list(map(str, h))
	return ' '.join(list_string)
t = input()
no = int(t)
s = ''
for i in range(no):
	r1 = input()
	r2 = input().split(' ')
	km = list(map(int, r2))
	s += corruptedArray(km) + '\n'
print(s)


def sanitize(arr, n):
	max_val = max(arr)
	arr.remove(max_val)
	adversary = sum(arr) - max_val
	try:
		adv_idx = arr.index(adversary)
		arr.pop(adv_idx)
		return arr
	except:
		next_max = max(arr)
		arr.remove(next_max)
		if sum(arr) == next_max:
			return arr
		return [-1]
t = int(input())
for i in range(t):
	n = int(input())
	line = input()
	a = [int(x) for x in line.split(' ')]
	result = [str(x) for x in sanitize(a, n)]
	print(' '.join(result))


def process(B):
	B2 = {}
	S = 0
	for x in B:
		if x not in B2:
			B2[x] = 0
		B2[x] += 1
		S += x
	works = False
	for x in B2:
		if (S - x) % 2 == 0 and (S - x) // 2 in B2:
			if (S - x) // 2 != x:
				works = True
				break
			elif (S - x) % 2 == 0 and (S - x) // 2 in B2 and (B2[(S - x) // 2] > 1):
				works = True
				break
	if works:
		B2[x] -= 1
		B2[(S - x) // 2] -= 1
		answer = []
		for x in B2:
			for y in range(B2[x]):
				answer.append(x)
		return answer
	else:
		return -1
t = int(input())
for i in range(t):
	n = int(input())
	B = [int(x) for x in input().split()]
	answer = process(B)
	if answer == -1:
		print(-1)
	else:
		print(' '.join(map(str, answer)))


def spr(A):
	s = sum(A)
	czek = {}
	for l in A:
		czek[l] = czek.get(l, 0) + 1
	for liczba in A:
		druga = (s - liczba) / 2
		if liczba == druga:
			if liczba in czek and czek[liczba] > 1:
				A.remove(liczba)
				A.remove(druga)
				A = list(map(str, A))
				return ' '.join(A)
		elif druga in czek and czek[druga] > 0:
			A.remove(liczba)
			A.remove(druga)
			A = list(map(str, A))
			return ' '.join(A)
	return -1

def main():
	for i in range(int(input())):
		n = int(input())
		print(spr(list(map(int, input().split()))))
main()


from collections import Counter as count
from bisect import bisect
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(int(input())):
	n = int(input())
	z = list(map(int, input().split()))
	z.sort()
	(a, b) = (n, n + 1)
	s = sum(z)
	ans = False
	for i in range(n + 2):
		if s - z[i] - z[a] == z[a] and i != a:
			ss = [z[i], z[a]]
			ans = True
			break
		elif s - z[i] - z[b] == z[b] and i != b:
			ss = [z[i], z[b]]
			ans = True
			break
	if ans and len(ss) == 2:
		for i in z:
			if i in ss:
				ss.remove(i)
			else:
				print(i, end=' ')
		print()
	else:
		print(-1)


def fxn(data):
	has = {}
	su = 0
	flag = False
	for i in data:
		su += i
		if i in has:
			has[i] += 1
		else:
			has[i] = 1
	for i in has:
		temp = su - i
		if temp % 2 != 0:
			continue
		temp = temp // 2
		if has[i] > 1:
			if i == temp:
				has[i] -= 2
				flag = True
				break
		if temp in has and i != temp:
			has[i] -= 1
			has[temp] -= 1
			flag = True
			break
	if not flag:
		return '-1'
	ans = ''
	for i in has:
		ans += (str(i) + ' ') * has[i]
	return ans[:-1]

def main():
	tests = int(input())
	for test in range(tests):
		n = int(input())
		arr = [int(i) for i in input().split(' ')]
		print(fxn(arr))
import math
main()


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	s1 = sum(arr[:-2])
	s2 = sum(arr[:-1]) - arr[-1]
	if s1 == arr[-2] or s1 == arr[-1]:
		arr = arr[:-2]
	elif s2 in arr[:-2]:
		arr.remove(arr[-1])
		arr.remove(s2)
	else:
		arr = [-1]
	for i in arr:
		print(i, end=' ')
	print()


def solve_problem(n, data):
	sarr = sorted(data)
	s = sum(sarr[:-2])
	if s > sarr[-2] and s > sarr[-1]:
		return [-1]
	elif s == sarr[-1]:
		return sarr[:-2]
	elif s == sarr[-2]:
		return sarr[:-2]
	sc = s + sarr[-2]
	s = sarr[-1]
	for i in range(len(sarr) - 1):
		if sc - sarr[i] == s:
			return sarr[:i] + sarr[i + 1:-1]
	return [-1]

def solve():
	t = int(input())
	for i in range(0, t):
		n = int(input())
		layers = input()
		ais = [int(x) for x in layers.split()]
		result = solve_problem(n, ais)
		for x in result:
			print(x, end=' ')
		print()
solve()


t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	A = sorted(A)
	flag = 0
	if sum(A[:-2]) == A[n] or sum(A[:-2]) == A[n + 1]:
		for ele in A[:-2]:
			print(ele, end=' ')
		print('')
		continue
	else:
		nsum = sum(A[:-2])
		for i in range(n):
			if nsum - A[i] + A[n] == A[n + 1]:
				for x in range(n + 1):
					if x == i:
						continue
					else:
						print(A[x], end=' ')
				print('')
				flag = 1
				break
		if flag != 1:
			print(-1)


import os.path
from math import gcd, floor, ceil
from collections import *
import sys
mod = 1000000007
INF = float('inf')

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = inp()
	l = li()
	l.sort()
	last = l[-1]
	s = sum(l)
	if s - l[-1] - l[-2] == l[-2]:
		print(*l[:n])
		return
	left = s - last
	for i in range(n + 1):
		c = left - l[i]
		if c == last:
			ans = l[:i] + l[i + 1:n + 1]
			print(*ans)
			return
	pr(-1)
for _ in range(inp()):
	solve()


t = int(input())

def eee(L, n):
	L.sort()
	c = sum(L)
	if c - 2 * L[-1] in L and L.index(c - 2 * L[-1]) != n + 1:
		i = L.index(c - 2 * L[-1])
		li = []
		for k in range(n + 2):
			if k != i and k != n + 1:
				li.append(L[k])
		return li
	if L[-2] == c - L[-2] - L[-1]:
		return L[0:n]
	return [-1]
for loop in range(t):
	n = int(input())
	L = [int(x) for x in input().split()]
	final = eee(L, n)
	if final == [-1]:
		print(-1)
	else:
		for element in final:
			print(element, end=' ')
		print()


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	flag = 0
	S = sum(a[:n])
	if S == a[n + 1] or S == a[n]:
		print(*a[:n])
	else:
		summ = sum(a[:n + 1])
		for i in range(n + 1):
			if a[n + 1] == summ - a[i]:
				a.pop(i)
				flag = 1
				break
		if flag == 1:
			print(*a[:n])
		else:
			print(-1)


from collections import *
from random import *
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def st():
	return input().rstrip('\n')

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())
t = inp()
while t:
	t -= 1
	n = inp()
	a = lis()
	z = sum(a)
	f = Counter(a)
	fl = 0
	for i in a:
		cur = z - 2 * i
		if cur == i:
			if i in f and f[i] > 1:
				a.remove(i)
				a.remove(i)
				print(*a)
				fl = 1
				break
		elif cur in f:
			a.remove(i)
			a.remove(cur)
			fl = 1
			print(*a)
			break
	if fl == 0:
		print(-1)


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
for _ in range(int(input())):
	n = int(input())
	b = list(map(int, input().split()))
	b.sort()
	last = b[-1]
	s = sum(b)
	s -= last
	ind = -1
	flag = False
	for i in range(len(b) - 1):
		if s - b[i] == last:
			ind = i
			flag = True
			break
	if s - b[-2] == b[-2]:
		flag = False
		ind = 0
	if ind != -1:
		ans = []
		if flag:
			for i in range(len(b) - 1):
				if i != ind:
					ans.append(b[i])
		else:
			for i in range(len(b) - 2):
				ans.append(b[i])
		print(*ans)
	else:
		print(-1)


ll = lambda : map(int, input().split())
t = lambda : int(input())
ss = lambda : input()
lx = lambda x: map(int, input().split(x))
from math import log10, log2, ceil, factorial as fac, gcd
for _ in range(t()):
	n = t()
	b = list(ll())
	nb = n + 2
	a = sorted(b)
	x = a[:n]
	s = sum(x)
	if s in a[n:]:
		print(*x)
		continue
	(fi, sec) = (a[-1], a[-2])
	for i in range(n):
		if s - x[i] + sec == fi:
			x[i] = sec
			print(*x)
			break
		elif s - x[i] + fi == sec:
			x[i] = fi
			print(*a)
			break
	else:
		print(-1)