You found a useless array a of 2n positive integers. You have realized that you actually don't need this array, so you decided to throw out all elements of a.

It could have been an easy task, but it turned out that you should follow some rules: 

  1. In the beginning, you select any positive integer x.
  2. Then you do the following operation n times: 
    * select two elements of array with sum equals x; 
    * remove them from a and replace x with maximum of that two numbers. 



For example, if initially a = [3, 5, 1, 2], you can select x = 6. Then you can select the second and the third elements of a with sum 5 + 1 = 6 and throw them out. After this operation, x equals 5 and there are two elements in array: 3 and 2. You can throw them out on the next operation.

Note, that you choose x before the start and can't change it as you want between the operations.

Determine how should you behave to throw out all elements of a.

Input

The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases.

The first line of each test case contains the single integer n (1 ≤ n ≤ 1000).

The second line of each test case contains 2n integers a_1, a_2, ..., a_{2n} (1 ≤ a_i ≤ 10^6) — the initial array a.

It is guaranteed that the total sum of n over all test cases doesn't exceed 1000.

Output

For each test case in the first line print YES if it is possible to throw out all elements of the array and NO otherwise.

If it is possible to throw out all elements, print the initial value of x you've chosen. Print description of n operations next. For each operation, print the pair of integers you remove.

Example

Input


4
2
3 5 1 2
3
1 1 8 8 64 64
2
1 1 2 4
5
1 2 3 4 5 6 7 14 3 11


Output


YES
6
1 5
2 3
NO
NO
YES
21
14 7
3 11
5 6
2 4
3 1

Note

The first test case was described in the statement.

In the second and third test cases, we can show that it is impossible to throw out all elements of array a.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Constructive algorithms

Sorting

Implementation

Complete search

Greedy algorithms

Data structures


Solutions:
from sys import stdin
input = stdin.readline
q = int(input())
for _ in range(q):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = a[-1]
	a.pop()
	for i in range(2 * n - 1):
		d = {}
		for ii in range(2 * n - 1):
			if ii == i:
				continue
			try:
				d[a[ii]].append(ii)
			except:
				d[a[ii]] = [ii]
		done = True
		ans = []
		ans.append([l, a[i]])
		x = l + a[i]
		bar = [False for i in range(2 * n - 1)]
		bar[i] = True
		curr = l
		for j in range(2 * n - 2, -1, -1):
			if bar[j] == True:
				continue
			bar[j] = True
			d[a[j]].pop()
			if curr - a[j] not in d:
				done = False
				break
			if len(d[curr - a[j]]) == 0:
				del d[curr - a[j]]
				done = False
				break
			temp = d[curr - a[j]].pop()
			bar[temp] = True
			ans.append([a[j], curr - a[j]])
			done = True
			curr = a[j]
		if done == True:
			print('YES')
			print(x)
			for i in ans:
				print(*i)
			break
	if done == False:
		print('NO')


def solve():
	n = int(input())
	a = sorted(list(map(int, input().split())))
	xs = [el + a[-1] for el in a[:-1]]
	for x in xs:
		(res, ans) = foo(a, x)
		if res:
			print('YES')
			print(x)
			for t in ans:
				print(*t)
			return
	print('NO')

def foo(a, x):
	n = len(a) // 2
	res = True
	ans = []
	for i in range(n):
		j = 0
		while j < len(a) - 1 and a[j] + a[-1] != x:
			j += 1
		if j == len(a) - 1 or a[j] + a[-1] != x:
			res = False
			return (res, ans)
		ans.append((a[j], a[-1]))
		x = a[-1]
		a = a[:j] + a[j + 1:-1]
	return (res, ans)
for _ in range(int(input())):
	solve()


from sys import stdin, stdout
from collections import deque
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a = sorted(a)
	a = deque(a)
	freq = {}
	for i in a:
		freq[i] = freq.get(i, 0) + 1
	ans = []
	pivot = max(a)
	b = 0
	p1 = a.pop()
	freq[p1] -= 1
	for i in a:
		if b:
			break
		p1 = pivot
		ans = [(i, pivot)]
		dict = freq.copy()
		vals = a.copy()
		vals.remove(i)
		dict[i] -= 1
		while 1:
			if len(vals) == 0:
				b = 1
				break
			if dict[vals[-1]] <= 0:
				vals.pop()
				continue
			p2 = vals.pop()
			dict[p2] -= 1
			if dict.get(p1 - p2, 0) <= 0:
				break
			dict[p1 - p2] -= 1
			ans.append((p2, p1 - p2))
			p1 = p2
	if not b:
		print('NO')
		continue
	print('YES')
	print(ans[0][1] + ans[0][0])
	for i in ans:
		stdout.write(str(i[0]) + ' ' + str(i[1]) + '\n')


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	rhs = n
	lhs = 0
	flag2 = 0
	for i in range(2 * n - 1):
		dic = {}
		for j in range(2 * n):
			if a[j] in dic:
				dic[a[j]] += 1
			else:
				dic[a[j]] = 1
		x = a[i] + a[2 * n - 1]
		ans = x
		ans2 = []
		curr = 2 * n - 1
		for j in range(n):
			flag = 0
			while dic[a[curr]] == 0:
				curr -= 1
			dic[a[curr]] -= 1
			r = x - a[curr]
			if not r in dic or dic[r] == 0:
				flag = 1
				break
			dic[r] -= 1
			ans2.append(str(r))
			ans2.append(str(a[curr]))
			x = a[curr]
		if flag == 0:
			print('YES')
			print(ans)
			print(' '.join(ans2))
			flag2 = 1
			break
	if flag2 == 0:
		print('NO')


from functools import cmp_to_key
from collections import deque, Counter
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
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')
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))

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()

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def ii():
	return int(inp())

def si():
	return str(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

def lsi():
	return list(map(str, inp().split()))

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)
MOD = 10 ** 9 + 7
maxN = 5
FACT = [0] * maxN
INV_FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def inverseFactorials():
	n = len(INV_FACT)
	INV_FACT[n - 1] = inverse(FACT[n - 1])
	for i in range(n - 2, -1, -1):
		INV_FACT[i] = multiply(INV_FACT[i + 1], i + 1)

def coeffBinom(n, k):
	if n < k:
		return 0
	return multiply(FACT[n], multiply(INV_FACT[k], INV_FACT[n - k]))

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path
from copy import deepcopy

def subandremove(d, el):
	d[el] -= 1
	if d[el] == 0:
		d.pop(el)

def f(a, n):
	for i in range(n - 1):
		cc = {}
		for el in a:
			cc[el] = cc.get(el, 0) + 1
		x = a[i] + a[-1]
		kkk = 2
		subandremove(cc, a[i])
		subandremove(cc, a[n - 1])
		x = a[-1]
		pu = n - 1
		while kkk != n:
			while a[pu] not in cc:
				pu -= 1
			el = x - a[pu]
			if el in cc and el == a[pu] and (cc[el] >= 2):
				subandremove(cc, a[pu])
				subandremove(cc, el)
				kkk = kkk + 2
				x = a[pu]
			elif el in cc and el != a[pu]:
				subandremove(cc, a[pu])
				subandremove(cc, el)
				kkk = kkk + 2
				x = a[pu]
			else:
				break
		if kkk == n:
			return a[i] + a[n - 1]
	return None

def g(a, n, x):
	cc = {}
	for el in a:
		cc[el] = cc.get(el, 0) + 1
	coppie = [a[n - 1]]
	coppie.append(x - a[n - 1])
	kkk = 2
	subandremove(cc, a[n - 1])
	subandremove(cc, x - a[n - 1])
	x = a[-1]
	pu = n - 1
	while kkk != n:
		while a[pu] not in cc:
			pu -= 1
		el = x - a[pu]
		if el in cc and el == a[pu] and (cc[el] >= 2):
			subandremove(cc, a[pu])
			subandremove(cc, el)
			coppie.append(a[pu])
			coppie.append(el)
			kkk = kkk + 2
			x = a[pu]
		elif el in cc and el != a[pu]:
			subandremove(cc, a[pu])
			subandremove(cc, el)
			coppie.append(a[pu])
			coppie.append(el)
			kkk = kkk + 2
			x = a[pu]
		else:
			break
	return coppie
for test in range(ii()):
	n = 2 * ii()
	a = sorted(li())
	b = f(a, n)
	if b == None:
		print('NO')
	else:
		print('YES')
		print(b)
		coppie = g(a, n, b)
		for i in range(n // 2):
			print_list([coppie[2 * i], coppie[2 * i + 1]])


from math import *
from sys import *
from bisect import *
from collections import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	a = a[::-1]
	n = 2 * n
	g = 0
	for i in range(1, n):
		c = Counter(a)
		mx = a[0]
		x = a[i]
		ans = []
		ans.append([mx, x])
		f = 0
		c[mx] -= 1
		c[x] -= 1
		for j in range(1, n):
			if i == j:
				continue
			if c[a[j]] >= 1:
				c[a[j]] -= 1
				if c[mx - a[j]] > 0:
					c[mx - a[j]] -= 1
					ans.append([a[j], mx - a[j]])
					mx = max(a[j], mx - a[j])
				else:
					c[a[j]] += 1
		f = 1
		for i in range(len(a)):
			if c[a[i]] > 0:
				f = 0
				break
		if f == 1:
			print('YES')
			print(sum(ans[0]))
			for j in range(n // 2):
				print(*ans[j])
			g = 1
			break
	if g == 0:
		print('NO')


from sys import stdin, stdout

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

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

def read_int_tuple():
	return tuple(map(int, input().split()))

def read_int():
	return int(input())

class IndexingList:
	from collections import defaultdict

	def __init__(self, lst):
		self.lst = lst
		self.indexes = self.defaultdict(set)
		for (i, e) in enumerate(self.lst):
			self.indexes[e].add(i)

	def __getitem__(self, k):
		assert isinstance(k, int)
		return self.lst[k]

	def __setitem__(self, k, v):
		assert isinstance(k, int)
		old_v = self.lst[k]
		self.indexes[old_v].remove(k)
		self.indexes[v].add(k)
		self.lst[k] = v

	def __len__(self):
		return len(self.lst)

	def index(self, k, exclude=None):
		s = self.indexes[k]
		if len(s) == 0:
			return False
		for c in s:
			if c != exclude:
				return c
		return False

	def __repr__(self):
		return self.lst.__repr__()

	def __eq__(self, other):
		if isinstance(other, IndexingList):
			return self.lst == other.lst
		elif isinstance(other, list):
			return self.lst == other
		assert False

def ok(A, target):
	A = IndexingList(A[:])
	n = len(A) // 2
	i = 0
	ret = []
	for _ in range(n):
		while i < len(A) and A[i] == -1:
			i += 1
		if i == len(A):
			return False
		j = A.index(target - A[i], i)
		if j == False:
			return False
		target = A[i]
		ret += [(A[i], A[j])]
		A[i] = -1
		A[j] = -1
	return ret

def ans(A):
	A = sorted(A)[::-1]
	for j in range(1, len(A)):
		o = ok(A, A[0] + A[j])
		if o == False:
			continue
		else:
			print('YES')
			print(A[0] + A[j])
			for p in o:
				print(*p)
			return
	print('NO')
for _ in range(read_int()):
	input()
	A = read_int_list()
	ans(A)


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')

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

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

def itg():
	return int(inp())

class SortedList:

	def __init__(self, values=None, _load=200):
		if values is None:
			values = []
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos], _list_lens[pos], _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __bool__(self):
		return self._len != 0

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))

def solve():
	n = itg()
	arr = sorted(mpint())
	mx = arr.pop()
	for num in arr:
		sl = SortedList(arr)
		sl.discard(num)
		ans = [(num + mx,), (mx, num)]
		x = mx
		for _ in range(n - 1):
			a = sl.pop()
			b = x - a
			if b not in sl:
				break
			sl.discard(b)
			ans.append((a, b))
			x = a
		else:
			print('YES')
			for tp in ans:
				print(*tp)
			return
	print('NO')

def main():
	for _ in range(itg()):
		solve()
DEBUG = 0
URL = 'https://codeforces.com/contest/1474/problem/C'
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 != 3:
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG:
		_print = print

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


from collections import Counter

def main():
	cases = int(input())
	ans_list = []
	for _ in range(cases):
		n = int(input())
		arr = map(int, input().split(' '))
		arr = sorted(arr, reverse=True)
		for try_val in arr[1:]:
			rem = Counter(arr)
			target = arr[0]
			cur_ans = [(target, try_val)]
			rem[target] -= 1
			rem[try_val] -= 1
			success = True
			for val in arr[1:]:
				if rem[val] == 0:
					continue
				if target - val != val and rem[target - val] > 0 or (target - val == val and rem[target - val] > 1):
					cur_ans.append((val, target - val))
					rem[val] -= 1
					rem[target - val] -= 1
					target = val
				else:
					success = False
					break
			if success:
				break
		if success:
			ans_list.append('YES')
			ans_list.append(str(cur_ans[0][0] + cur_ans[0][1]))
			for (x, y) in cur_ans:
				ans_list.append('{} {}'.format(x, y))
		else:
			ans_list.append('NO')
	print('\n'.join(ans_list))
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')
main()


import sys
input = sys.stdin.buffer.readline
a = int(input())
for x in range(a):
	b = int(input())
	c = list(map(int, input().split()))
	c.sort(reverse=True)
	d = c[0]
	h = 0
	l = []
	sss = {}
	for y in range(2 * b):
		if sss.get(c[y]) == None:
			sss[c[y]] = 1
		else:
			sss[c[y]] += 1
	for y in range(1, 2 * b):
		ss = sss.copy()
		p = c.copy()
		l.append([c[y], c[0]])
		ss[c[0]] -= 1
		ss[c[y]] -= 1
		n = d
		for z in range(1, 2 * b - 1):
			if z == y:
				continue
			elif ss.get(c[z]) == 0:
				continue
			elif ss.get(n - c[z]) != None and ss.get(n - c[z]) >= 1:
				if n - c[z] == c[z]:
					if ss.get(n - c[z]) >= 2:
						l.append([n - c[z], c[z]])
						ss[c[z]] -= 1
						ss[n - c[z]] -= 1
						n = max(c[z], n - c[z])
					else:
						h = -1
						break
				else:
					l.append([n - c[z], c[z]])
					ss[c[z]] -= 1
					ss[n - c[z]] -= 1
					n = max(n - c[z], c[z])
			else:
				h = -1
				break
		if len(l) == b:
			break
		else:
			l = []
			h = 0
	if len(l) == 0:
		print('NO')
	else:
		print('YES')
		print(sum(l[0]))
		for y in l:
			print(*y)


import sys

def radix_sort(lst, d):
	rlist = [[] for i in range(10)]
	llen = len(lst)
	for m in range(d):
		for j in range(llen):
			rlist[lst[j] // 10 ** m % 10].append(lst[j])
		j = 0
		for i in range(10):
			tmp = rlist[i]
			for k in range(len(tmp)):
				lst[j] = tmp[k]
				j += 1
			rlist[i].clear()

def solve2(lst, n):
	radix_sort(lst, 7)
	dic = {}
	for i in range(len(lst) - 1):
		try:
			dic[lst[i]] += 1
		except:
			dic[lst[i]] = 1
	se = list(dic.keys())
	for i in se:
		ans = [[lst[-1], i]]
		dicc = dic.copy()
		if dicc[i] == 1:
			del dicc[i]
		else:
			dicc[i] -= 1
		MAX = lst[-1]
		j = 2 * n - 2
		while j >= 0 and len(ans) < n:
			try:
				if dicc[lst[j]] == 1:
					del dicc[lst[j]]
				else:
					dicc[lst[j]] -= 1
			except:
				j -= 1
				continue
			try:
				need = MAX - lst[j]
				if dicc[need] == 1:
					del dicc[need]
				else:
					dicc[need] -= 1
				ans.append([lst[j], need])
				MAX = lst[j]
				j -= 1
			except:
				break
		if len(ans) == n:
			print('YES')
			print(sum(ans[0]))
			for i in ans:
				print(i[0], i[1])
			return
	print('NO')
	return
t = int(input())
for qwq in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	solve2(lst, n)


import sys
input = sys.stdin.readline
import heapq
from collections import Counter

def check_seq(seq, big, sol):
	big = -big
	seq = [-elem for elem in seq]
	c = Counter(seq)
	seq.sort(reverse=True)
	while len(seq) > 0:
		big_neg_rem = seq.pop()
		if c[big_neg_rem] < 1:
			continue
		c[big_neg_rem] -= 1
		other = big - big_neg_rem
		if other not in c or c[other] <= 0:
			return (False, c)
		c[other] -= 1
		sol.append([-big_neg_rem, -other])
		big = big_neg_rem
	return (True, c)

def print_sol(sol):
	print('YES')
	print(sum(sol[0]))
	for [u, v] in sol:
		print(str(u) + ' ' + str(v))

def solution(n, arr):
	arr.sort()
	big1 = arr.pop()
	sol1 = []
	sol2 = []
	big2 = arr.pop()
	sol1.append([big1, big2])
	(result, c) = check_seq(arr, big1, sol1)
	if result:
		print_sol(sol1)
		return
	arr.append(big2)
	for pos in range(len(arr)):
		out_elem = arr[pos]
		arr2 = arr[0:pos] + arr[pos + 1:]
		sol2 = []
		(result, c) = check_seq(arr2, big1, sol2)
		if result:
			sol2 = [[big1, out_elem]] + sol2
			print_sol(sol2)
			return
	print('NO')
T = int(input())
for t in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	solution(n, arr)


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	last = a.pop()
	cnta = Counter(a)
	keylist = list(cnta)
	history = []
	ans = 'NO'
	start_x = 0
	for drop in keylist:
		removed_cnt = Counter((drop,))
		start_x = last + drop
		sum_ = last
		history.append(f'{sum_} {drop}')
		i = 1
		for _ in range(n - 1):
			x = 0
			while i <= len(keylist):
				k = keylist[-i]
				if k not in removed_cnt or cnta[k] - removed_cnt[k] > 0:
					x = k
					break
				i += 1
			if i > len(keylist):
				break
			else:
				i += 1
			removed_cnt[x] += 1
			y = sum_ - x
			if cnta[y] - removed_cnt[y] > 0:
				removed_cnt[y] += 1
				history.append(f'{x} {y}')
				sum_ = x
			else:
				break
		else:
			ans = 'YES'
			break
		history.clear()
	print(ans)
	if ans == 'YES':
		print(start_x)
		print('\n'.join(history))


from collections import Counter

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

def f(a_seq, n):
	a_seq = list(a_seq)
	max_element = max(a_seq)
	for a in a_seq:
		try:
			return f_x_known(a_seq, n, max_element + a)
		except ValueError:
			pass
	raise ValueError

def f_x_known(a_seq, n, x):
	a_seq = sorted(a_seq)
	assert len(a_seq) == 2 * n
	counter = Counter(a_seq)
	result_ops = []
	if n == 0:
		return result_ops
	for a in reversed(a_seq):
		if counter[a] == 0:
			continue
		min_need = x - a
		if counter[min_need] == 0 or (min_need == a and counter[a] < 2):
			raise ValueError
		counter[min_need] -= 1
		counter[a] -= 1
		result_ops.append((min_need, a))
		x = a
	counter = list(counter.elements())
	assert len(counter) == 0
	return result_ops
(t_n,) = read_ints()
for i_t in range(t_n):
	(n,) = read_ints()
	a_seq = list(read_ints())
	try:
		operations = f(a_seq, n)
	except ValueError:
		print('NO')
	else:
		print('YES')
		if operations:
			x = sum(operations[0])
			print(x)
			for (a1, a2) in operations:
				print(a1, a2)


def f(a, cur, ress):
	g = {}
	ress.clear()
	for i in range(len(a)):
		if a[i] not in g:
			g[a[i]] = [i]
		else:
			g[a[i]].append(i)
	for v in a:
		if not v in g:
			continue
		g[v].pop()
		if len(g[v]) == 0:
			del g[v]
		vv = cur - v
		if vv not in g:
			return False
		ress.append([v, vv])
		g[vv].pop()
		if not g[vv]:
			del g[vv]
		cur = v
	return True
for _ in range(int(input())):
	n = int(input()) * 2
	a = sorted([*map(int, input().split())], reverse=True)
	res = []
	for i in range(1, n):
		if f(a[1:i] + a[i + 1:n], a[0], res):
			res = [[a[0], a[i]]] + res
			print('YES')
			print(a[0] + a[i])
			for (x, y) in res:
				print(x, y)
			break
	else:
		print('NO')


def rec(arr, m, start, n, x, step, opp):
	if step >= n // 2:
		return True
	while start < n and m[arr[start]] == 0:
		start += 1
	if start == n:
		return False
	left = arr[start]
	conj = x - left
	res = False
	m[left] = m[left] - 1
	if conj in m and m[conj] > 0:
		m[conj] = m[conj] - 1
		opp.append((left, conj))
		res = rec(arr, m, start + 1, n, left, step + 1, opp)
		if res is False:
			m[conj] = m[conj] + 1
			opp.pop()
	m[left] = m[left] + 1
	return res

def createCountMap(arr):
	m = {}
	for i in arr:
		m[i] = m.get(i, 0) + 1
	return m
t = int(input())
while t > 0:
	arr = []
	t -= 1
	n = int(input()) * 2
	tem = input().strip().split()
	for i in range(n):
		val = int(tem[i])
		arr.append(val)
	arr = sorted(arr, reverse=True)
	if n == 2:
		print('YES')
		print(arr[0] + arr[1])
		print(arr[0], arr[1])
		continue
	m = createCountMap(arr)
	opp = []
	m[arr[0]] = m[arr[0]] - 1
	flag = False
	for i in range(1, n):
		prospect = arr[i]
		m[prospect] = m[prospect] - 1
		start = 1
		if i == 1:
			start = 2
		opp.append((arr[0], prospect))
		flag = rec(arr, m, start, n, arr[0], 1, opp)
		if flag:
			print('YES')
			print(prospect + arr[0])
			for (a, b) in opp:
				print(a, b)
			break
		else:
			m[prospect] = m[prospect] + 1
			opp = []
	if flag is False:
		print('NO')


from sys import stdin
from collections import Counter
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort(reverse=True)
	d = Counter(a)
	possible_x = [a[0] + a[i] for i in range(1, 2 * n)]
	for x in possible_x:
		y = x
		ans = []
		c = d.copy()
		pairs_found = 0
		ans_found = False
		i = 0
		while True:
			while c[a[i]] == 0:
				i += 1
			c[a[i]] -= 1
			if c[x - a[i]] > 0:
				c[x - a[i]] -= 1
				ans.append((a[i], x - a[i]))
				x = a[i]
				pairs_found += 1
			else:
				break
			if pairs_found == n:
				ans_found = True
				break
			i += 1
		if ans_found:
			break
	if ans_found:
		print('YES')
		print(y)
		for i in ans:
			print(*i)
	else:
		print('NO')


import sys, os, io
from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	a = [int(i) for i in input().split()]
	a.sort()
	dic = defaultdict(lambda : 0)
	for i in range(n):
		dic[a[i]] += 1
	a1 = a[:]
	dic1 = dic.copy()
	for i in range(n - 1):
		a = a1[:]
		ans = []
		dic = dic1.copy()
		curr = a[-1]
		a.pop()
		dic[curr] -= 1
		dic[a[i]] -= 1
		ans.append([curr, a[i]])
		flag = 0
		while len(a) > 0:
			now = a[-1]
			a.pop()
			while dic[now] == 0 and len(a) > 0:
				now = a[-1]
				a.pop()
			dic[now] -= 1
			if curr - now in dic and dic[curr - now] > 0:
				dic[curr - now] -= 1
				if a[-1] == curr - now:
					a.pop()
				ans.append([now, curr - now])
				curr = now
			else:
				if len(a) == 0:
					break
				flag = 1
				break
		if flag == 0:
			print('YES')
			print(ans[0][0] + ans[0][1])
			for i in ans:
				print(*i)
			break
	if flag == 1:
		print('NO')


def check(a, x, res):
	res.clear()
	d = {}
	for i in range(len(a)):
		if not a[i] in d:
			d[a[i]] = [i]
		else:
			d[a[i]].append(i)
	for val in a:
		if not val in d:
			continue
		d[val].pop()
		if len(d[val]) == 0:
			del d[val]
		y = x - val
		if not y in d:
			return False
		res.append([val, y])
		d[y].pop()
		if len(d[y]) == 0:
			del d[y]
		x = val
	return True
for _ in range(int(input())):
	n = int(input()) * 2
	a = sorted([int(x) for x in input().split()], reverse=True)
	res = []
	for i in range(1, n):
		if check(a[1:i] + a[i + 1:n], a[0], res):
			res = [[a[0], a[i]]] + res
			print('YES')
			print(a[0] + a[i])
			for (x, y) in res:
				print(x, y)
			break
	else:
		print('NO')


import collections
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	v = {}
	d = collections.Counter(a)
	l = []
	c = 0
	m = a[-1]

	def check(v, x, l):
		c = 0
		for i in range(2 * n - 1, -1, -1):
			if v[a[i]] > 0:
				if v[x - a[i]] > 0:
					l.append([x - a[i], a[i]])
					v[a[i]] -= 1
					v[x - a[i]] -= 1
					x = a[i]
					c += 1
				else:
					return False
		if c == n:
			return True
	f = 0
	for i in d:
		v = d.copy()
		l = []
		if check(v, m + i, l):
			f = 1
			print('YES')
			print(i + m)
			for j in range(n):
				print(*l[j])
			break
	if f == 0:
		print('NO')


import sys
T = int(sys.stdin.readline().strip())
while T > 0:
	T -= 1
	n = int(sys.stdin.readline().strip())
	a = sys.stdin.readline().strip().split(' ')
	m = -1
	cnt = {}
	for one in a:
		x = int(one)
		cnt[x] = cnt.get(x, 0) + 1
	ml = sorted(list(cnt.keys()), reverse=True)
	cnt1 = cnt.copy()
	Flag = False
	for m1 in cnt1:
		cnt = cnt1.copy()
		now = 0
		m = ml[now]
		rl = [[m, m1]]
		cnt[m] -= 1
		if cnt[m] == 0:
			del cnt[m]
		if m1 not in cnt:
			continue
		cnt[m1] -= 1
		if cnt[m1] == 0:
			del cnt[m1]
		for i in range(n - 1):
			while cnt.get(ml[now], 0) == 0:
				now += 1
			x = ml[now]
			cnt[x] -= 1
			if cnt[x] == 0:
				del cnt[x]
			y = rl[-1][0] - x
			if y not in cnt:
				break
			cnt[y] -= 1
			if cnt[y] == 0:
				del cnt[y]
			rl.append([x, y])
		if len(cnt) != 0:
			continue
		Flag = True
		print('YES')
		print(rl[0][1] + rl[0][0])
		for one in rl:
			print(one[0], one[1])
		break
	if not Flag:
		print('NO')


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations, permutations
from bisect import *
from fractions import Fraction
from heapq import *
from random import randint

def main():
	for _ in range(int(input())):
		n = int(input())
		a = sorted(map(int, input().split()))
		(zz, f) = ([], 0)
		for i in range(2 * n - 2, -1, -1):
			b = Counter(a)
			b[a[-1]] -= 1
			b[a[i]] -= 1
			d = []
			d.append((a[-1], a[i]))
			z = 0
			j = 2 * n - 2 - (i == 2 * n - 2)
			x = a[-1]
			while j >= 0 and (b[x - a[j]] if x - a[j] != a[j] else b[x - a[j]] >= 2):
				b[x - a[j]] -= 1
				b[a[j]] -= 1
				d.append((a[j], x - a[j]))
				x = max(a[j], x - a[j])
				z += 1
				if z == n - 1:
					break
				j -= 1
				while j >= 0 and (not b[a[j]]):
					j -= 1
			if z == n - 1:
				zz = d
				f = 1
				break
		if f:
			print('YES')
			print(sum(zz[0]))
			for i in zz:
				print(*i)
		else:
			print('NO')
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')
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	a.reverse()
	x = []
	for j in range(1, 2 * n):
		x.append(a[0] + a[j])
	for j in range(len(x)):
		x1 = x[j]
		w = [[x1]]
		t = 0
		val = 0
		d = {}
		aj = 0
		for j1 in range(2 * n):
			if a[j1] not in d:
				d[a[j1]] = [j1]
			else:
				d[a[j1]].append(j1)
		for val in a:
			if val not in d:
				continue
			d[val].pop()
			y = x1 - val
			x1 = val + 0
			w.append([val])
			if len(d[val]) == 0:
				del d[val]
			if y not in d:
				aj = 37
				break
			d[y].pop()
			w[-1].append(y)
			if len(d[y]) == 0:
				del d[y]
		if aj == 0:
			break
	if aj == 0:
		print('YES')
		for q in w:
			print(*q)
	else:
		print('NO')


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	a = [int(x) for x in input().split(' ')]
	a.sort()
	a_dict = {}
	for x in a:
		if x in a_dict:
			a_dict[x] += 1
		else:
			a_dict[x] = 1

	def poss(i):
		b = a.copy()
		b_dict = a_dict.copy()
		z = b.pop()
		y = b[i]
		b_dict[y] -= 1
		b_dict[z] -= 1
		r = [(z, y)]
		while b:
			x = max(r[-1])
			z = b.pop()
			while b_dict[z] == 0 and b:
				z = b.pop()
			if b_dict[z] == 0:
				pass
			else:
				b_dict[z] -= 1
				y = x - z
				if y < 0 and b:
					print(r)
					return False
				elif y not in b_dict or (b_dict[y] == 0 and b):
					return False
				elif b_dict[y]:
					r.append((z, y))
					b_dict[y] -= 1
		return r
	for i in range(2 * n - 1):
		z = poss(i)
		if z:
			return [['YES'], [sum(z[0])], *z]
	return [['NO']]
t = int(input())
for case in range(t):
	x = solve()
	for y in x:
		print(*y)


import sys
input = sys.stdin.readline
from collections import Counter
cnt = Counter()
for _ in range(int(input())):
	n = int(input())
	A = sorted(map(int, input().split()), reverse=True)
	for k in range(1, 2 * n):
		used = [0] * (2 * n)
		used[0] = used[k] = 1
		cur = A[0]
		ans = [[A[0], A[k]]]
		s = A[0] + A[k]
		cnt.clear()
		for i in range(1, 2 * n):
			if not used[i]:
				cnt[A[i]] += 1
		for i in range(1, 2 * n):
			if not cnt[A[i]]:
				continue
			cnt[A[i]] -= 1
			target = cur - A[i]
			if not cnt[target]:
				break
			cnt[target] -= 1
			ans.append([A[i], target])
			cur = A[i]
		else:
			print('YES')
			print(s)
			for a in ans:
				print(*a)
			break
	else:
		print('NO')


import sys
import math

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

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

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

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

def FACT(n, mod):
	s = 1
	facts = [1]
	for i in range(1, n + 1):
		s *= i
		s %= mod
		facts.append(s)
	return facts[n]

def C(n, k, mod):
	return FACT(n, mod) * pow(FACT(k, mod) * FACT(n - k, mod) % mod, mod - 2, mod) % mod
for _ in range(II()):
	n = II()
	a = LI()
	a.sort(reverse=True)
	tar = []
	dic = {}
	dic[a[0]] = 1
	for i in range(1, 2 * n):
		tar.append(a[0] + a[i])
		if dic.get(a[i]):
			dic[a[i]] += 1
		else:
			dic[a[i]] = 1
	ans = -1
	for i in tar:
		s = i
		d = dict(dic)
		ind = 0
		boo = True
		while ind < 2 * n:
			d[a[ind]] -= 1
			if not d.get(s - a[ind]):
				break
			d[s - a[ind]] -= 1
			s = a[ind]
			while ind < 2 * n and d.get(a[ind]) == 0:
				ind += 1
			if ind == 2 * n:
				break
		for j in d:
			if d[j] != 0:
				boo = False
				break
		if boo:
			ans = i
			break
	if ans == -1:
		print('NO')
	else:
		print('YES')
		print(ans)
		s = ans
		d = dic
		ind = 0
		boo = True
		while ind < 2 * n:
			print(a[ind], s - a[ind])
			d[a[ind]] -= 1
			d[s - a[ind]] -= 1
			s = a[ind]
			while ind < 2 * n and d.get(a[ind]) == 0:
				ind += 1


def f(first, second, a, steps):
	a.remove(second)
	ok = True
	sum = first
	while len(a) > 1:
		x = a.pop()
		y = sum - x
		if y in a:
			a.remove(y)
			sum = x
		else:
			ok = False
			break
		steps += [[x, y]]
	return ok
for _ in range(int(input())):
	n = int(input())
	a = sorted([int(x) for x in input().split()])
	first = a.pop()
	d = dict()
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	k = sorted(d.keys())
	while len(k) > 0:
		second = k.pop()
		steps = [[first, second]]
		initialx = first + second
		ok = f(first, second, a.copy(), steps)
		if ok:
			break
	if ok:
		print('YES')
		print(initialx)
		[print(x[0], x[1]) for x in steps]
	else:
		print('NO')


from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	n = n << 1
	arr = [int(i) for i in input().split()]
	arr.sort(reverse=True)
	has = False
	for i in range(1, n):
		nums = defaultdict(int)
		for each in arr:
			nums[each] += 1
		result = arr[0]
		nums[arr[0]] -= 1
		nums[arr[i]] -= 1
		cnt = 2
		index = 1
		while True:
			if cnt >= n:
				has = True
				break
			while True:
				if nums[arr[index]] > 0:
					nums[arr[index]] -= 1
					break
				index += 1
			if result - arr[index] not in nums or nums[result - arr[index]] <= 0:
				break
			else:
				nums[result - arr[index]] -= 1
				result = arr[index]
				cnt += 2
		if has:
			first_index = i
			break
	if has:
		print('YES')
		print(arr[first_index] + arr[0])
		print(arr[0], arr[first_index])
		nums = defaultdict(int)
		for each in arr:
			nums[each] += 1
		result = arr[0]
		nums[arr[0]] -= 1
		nums[arr[first_index]] -= 1
		cnt = 2
		index = 1
		while True:
			if cnt >= n:
				has = True
				break
			while True:
				if nums[arr[index]] > 0:
					nums[arr[index]] -= 1
					break
				index += 1
			if result - arr[index] not in nums or nums[result - arr[index]] <= 0:
				break
			else:
				print(arr[index], result - arr[index])
				nums[result - arr[index]] -= 1
				result = arr[index]
				cnt += 2
	else:
		print('NO')


import sys
import random
input = sys.stdin.readline

def iin():
	return int(input())

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

def nin():
	return map(int, sin().split())

def lin():
	return list(map(int, sin().split()))

def p(x):
	print(x)

def pl(l):
	for i in l:
		print(i, end=' ')

def pnl(l):
	pl(l)
	print()

def pyn(x):
	if x:
		print('YES')
	else:
		print('NO')
te = 1
te = iin()
while te > 0:
	n = iin()
	l = lin()
	l.sort()
	d = {}
	for i in l:
		d[i] = d.get(i, 0) + 1
	i = 0
	x = 0
	f = 0
	while f == 0 and i < 2 * n - 1:
		x = l[i] + l[-1]
		ans = []
		c = 0
		d1 = dict(d)
		px = x
		lf = 0
		li = 2 * n - 1
		while lf == 0 and c < n:
			if d1[l[li]] > 0:
				d1[l[li]] -= 1
				fi = px - l[li]
				if d1.get(fi, 0) > 0:
					ans.append([l[li], fi])
					px = l[li]
					li -= 1
					c += 1
					d1[fi] -= 1
				else:
					lf = 1
					break
			else:
				li -= 1
		if lf == 0:
			f = 1
		i += 1
	if f == 0:
		print('NO')
	else:
		print('YES')
		print(x)
		for i in ans:
			print(i[0], i[1])
	te -= 1


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	idx = 2 * n - 1
	done = False
	for i in range(2 * n - 1):
		m = arr[idx]
		c = Counter(arr[:i] + arr[i + 1:2 * n - 1])
		for j in range(2 * n - 2, -1, -1):
			if c[arr[j]] > 0:
				x = m - arr[j]
				c[arr[j]] -= 1
				if x in c and c[x] > 0:
					c[x] -= 1
					m = arr[j]
				else:
					break
		t = 0
		for k in c:
			t += c[k]
		if t == 0:
			done = True
			break
	if done:
		print('YES')
		print(arr[i] + arr[idx])
		print(arr[i], arr[idx])
		m = arr[idx]
		c = Counter(arr[:i] + arr[i + 1:2 * n - 1])
		for j in range(2 * n - 2, -1, -1):
			if c[arr[j]] > 0:
				x = m - arr[j]
				c[arr[j]] -= 1
				if x in c and c[x] > 0:
					c[x] -= 1
					m = arr[j]
					print(m, x)
				else:
					break
	else:
		print('NO')


import bisect
import sys
for _ in range(int(input())):
	n = int(input())
	name = sys.stdin.readline()
	l = list(map(int, name.split()))
	ans = []
	l.sort()
	ans = 'NO'
	ansList = []
	d = {}
	for i in l:
		if i not in d:
			d[i] = 0
		d[i] += 1
	maxi = max(l)
	i = 0
	j = len(l) - 1
	while i < j:
		removed = 2
		(ind1, ind2) = (1, len(l) - 2)
		f = 0
		dTemp = d.copy()
		e1 = l[i]
		dTemp[e1] -= 1
		e2 = l[len(l) - 1]
		dTemp[e2] -= 1
		ansList.append(e1 + e2)
		maxi = max(e1, e2)
		ansList.append(e1)
		ansList.append(e2)
		while ind2 > 0 and dTemp[l[ind2]] <= 0:
			ind2 -= 1
			if ind2 == 0:
				f = 1
				break
		if f == 1:
			ansList.clear()
			continue
		while removed < len(l):
			e2 = l[ind2]
			dTemp[e2] -= 1
			if maxi - e2 not in dTemp:
				f = 1
				break
			elif dTemp[maxi - e2] <= 0:
				f = 1
				break
			else:
				e1 = maxi - e2
				dTemp[e1] -= 1
			ansList.append(e1)
			ansList.append(e2)
			maxi = max(e1, e2)
			removed += 2
			ind2 -= 1
			if removed >= len(l):
				break
			while ind2 > 0 and dTemp[l[ind2]] <= 0:
				ind2 -= 1
				if ind2 == 0:
					f = 1
					break
			if f == 1:
				break
		i += 1
		if f == 0:
			ans = 'YES'
			break
		else:
			ansList.clear()
	if ans == 'NO':
		print(ans)
	else:
		print(ans)
		print(ansList[0])
		for i in range(1, len(ansList), 2):
			print(ansList[i], ansList[i + 1])


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	dic = {}
	for d in arr:
		if d not in dic:
			dic[d] = 0
		dic[d] += 1
	ans = []
	b = True
	for i in range(2 * n - 1):
		b = True
		dd = dic.copy()
		dd[arr[-1]] -= 1
		dd[arr[i]] -= 1
		x = max(arr[-1], arr[i])
		ans.append([arr[-1], arr[i]])
		k = 2 * n - 2
		c = 1
		while b and c < n and (k > -1):
			if dd[arr[k]] < 1:
				k -= 1
			elif x - arr[k] == arr[k] and dd[arr[k]] > 1:
				dd[arr[k]] -= 1
				dd[x - arr[k]] -= 1
				ans.append([arr[k], x - arr[k]])
				x = max(arr[k], x - arr[k])
				c += 1
				k -= 1
			elif x - arr[k] != arr[k] and x - arr[k] in dd and (dd[arr[k]] > 0) and (dd[x - arr[k]] > 0):
				dd[arr[k]] -= 1
				dd[x - arr[k]] -= 1
				c += 1
				ans.append([arr[k], x - arr[k]])
				x = max(arr[k], x - arr[k])
				k -= 1
			else:
				break
		if len(ans) != n:
			b = False
			ans = []
		else:
			break
	if b == False:
		print('NO')
	else:
		print('YES')
		print(sum(ans[0]))
		for d in ans:
			print(' '.join(map(str, d)))


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	di = {}
	for i in a:
		if i not in di:
			di[i] = 1
		else:
			di[i] += 1
	flag = 0
	for i in range(2 * n - 2, -1, -1):
		tmp = {}
		for j in di:
			tmp[j] = di[j]
		movs = [[a[2 * n - 1], a[i]]]
		tmp[a[i]] = tmp[a[i]] - 1
		maxi = a[2 * n - 1]
		counter = 0
		pair = 1
		for j in range(2 * n - 2, -1, -1):
			if j != i and tmp[a[j]] > 0:
				diff = maxi - a[j]
				if diff in tmp and tmp[diff] > 0 and (diff != a[j] or (diff == a[j] and tmp[diff] >= 2)):
					pair += 1
					movs.append([diff, a[j]])
					tmp[diff] = tmp[diff] - 1
					tmp[a[j]] = tmp[a[j]] - 1
					maxi = a[j]
				elif pair != n:
					counter = -1
					break
			if counter == -1:
				break
		if counter != -1:
			flag = 1
			print('YES')
			print(sum(movs[0]))
			for j in movs:
				print(*j)
			break
	if flag == 0:
		print('NO')


import sys
input = sys.stdin.buffer.readline

def dictonary():
	dicto = {}
	for i in range(2 * n):
		if a[i] in dicto:
			dicto[a[i]] += 1
		else:
			dicto[a[i]] = 1
	return dicto
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	i = 1
	ans = [0 for i in range(2 * n + 3)]
	dicto = {}
	while i < 2 * n:
		ans = [0 for i in range(2 * n + 1)]
		dicty = dictonary()
		dicty[a[0]] -= 1
		dicty[a[i]] -= 1
		ans[1] = a[0]
		ans[2] = a[i]
		k = 1
		j = 1
		while k < 2 * n:
			if dicty[a[k]] > 0:
				dicty[a[k]] -= 1
				if ans[j] - a[k] in dicty and dicty[ans[j] - a[k]] > 0:
					ans[j + 2] = a[k]
					ans[j + 3] = ans[j] - a[k]
					dicty[ans[j] - a[k]] -= 1
					j += 2
			k += 1
		if j == 2 * n - 1:
			break
		i += 1
	if j == 2 * n - 1:
		print('YES')
		print(ans[1] + ans[2])
		for i in range(1, 2 * n + 1, 2):
			print(ans[i], ans[i + 1])
	else:
		print('NO')


t = int(input())
outl = []
revo = [-1] * (10 ** 6 + 1)
rev = [-1] * (10 ** 6 + 1)
for _ in range(t):
	n = 2 * int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	for i in range(n - 1, -1, -1):
		revo[l[i]] = i

	def rem(v):
		if v < 0:
			return False
		if rev[v] == -1:
			return False
		if used[rev[v]]:
			return False
		used[rev[v]] = True
		if rev[v] + 1 != n and l[rev[v] + 1] == v:
			rev[v] += 1
		return True
	for i in range(n):
		if i == 0:
			continue
		used = [False] * n
		out = [(l[0], l[i])]
		for v in l:
			rev[v] = revo[v]
		rem(l[0])
		rem(l[i])
		works = True
		curr = l[0]
		for j in range(n):
			if not used[j]:
				rem(l[j])
				if rem(curr - l[j]):
					out.append((l[j], curr - l[j]))
					curr = l[j]
				else:
					works = False
					break
		if works:
			outl.append('YES')
			outl.append(str(l[0] + l[i]))
			for (u, v) in out:
				outl.append(f'{u} {v}')
			break
	else:
		outl.append('NO')
	for v in l:
		revo[v] = -1
		rev[v] = -1
print('\n'.join(outl))


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = sorted(list(map(int, stdin.readline().split())))[::-1]
	dct = {}
	flag = True
	for i in arr:
		if i not in dct:
			dct[i] = 1
		else:
			dct[i] += 1
	for i in arr[1:]:
		cnt = 0
		so = i + arr[0]
		dict2 = dct.copy()
		lst = [int(so)]
		for j in arr:
			if dict2[j] == 0:
				continue
			dict2[j] -= 1
			if so - j not in dict2 or dict2[so - j] == 0:
				break
			lst.append(str(j) + ' ' + str(so - j))
			dict2[so - j] -= 1
			so = j
		if len(lst) == n + 1:
			flag = False
			break
	if flag:
		print('no')
	else:
		print('yes')
		for i in lst:
			print(i)


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
import time
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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 collections import defaultdict as dd, deque as dq, Counter as dc
import math, string

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	A.sort()
	X_vals = [a + A[-1] for a in A[:-1]]
	for x in X_vals:
		ans = x
		CC = dc(A)
		cand = []
		idx = 2 * N - 1
		flag = True
		for i in range(N):
			while CC[A[idx]] == 0:
				idx -= 1
			num2 = x - A[idx]
			CC[A[idx]] -= 1
			if CC[num2]:
				CC[num2] -= 1
				cand.append((A[idx], num2))
				x = A[idx]
			else:
				flag = False
				break
		if flag:
			print('YES')
			print(ans)
			for (a, b) in cand:
				print(a, b)
			return
	print('NO')
	return
for _ in range(getInt()):
	solve()


import sys
input = sys.stdin.readline

def debug():
	for i in range(10):
		pass

def solve(arr, x):
	n = len(arr) // 2
	res = True
	ans = []
	for j in range(n):
		j = 0
		while j < len(arr) - 1 and arr[j] + arr[-1] != x:
			j += 1
		if j == len(arr) - 1 or arr[j] + arr[-1] > x:
			res = False
			return (res, ans)
		ans.append((arr[j], arr[-1]))
		x = arr[-1]
		arr = arr[:j] + arr[j + 1:-1]
	return (res, ans)
try:
	for _ in range(int(input())):
		n = int(input())
		arr = sorted([int(i) for i in input().split()])
		xs = [el + arr[-1] for el in arr[:-1]]
		flg = 0
		for x in xs:
			(res, ans) = solve(arr, x)
			if res:
				flg = 1
				print('YES')
				print(x)
				for i in ans:
					print(*i)
				break
		if not flg:
			print('NO')
except EOFError as e:
	print(e)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
from functools import lru_cache
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
aj = lambda : list(map(int, input().split()))

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
for _ in range(int(input())):
	N = int(input())
	A = aj()
	A.sort(reverse=True)
	maxi = A.pop(0)
	flag = 1
	for i in A:
		B = A.copy()
		B.remove(i)
		Ans = []
		C = Counter(B)
		m = maxi
		for j in B:
			if C[m - j] > 0 and C[j] > 0:
				if j == m - j and C[j] >= 2:
					Ans.append((j, j))
					C[j] -= 2
					m = j
				elif j != m - j:
					Ans.append((j, m - j))
					C[j] -= 1
					C[m - j] -= 1
					m = max(j, m - j)
		if len(Ans) == N - 1:
			Y(1)
			print(i + maxi)
			print(i, maxi)
			for k in Ans:
				print(*k)
			flag = 0
			break
	if flag:
		Y(0)


import os
import sys
from io import BytesIO, IOBase

def binary_search(l, n, k):
	s = 0
	e = n
	while s <= e:
		mid = (s + e) // 2
		if l[mid] == k:
			return mid
		elif k < l[mid]:
			e = mid - 1
		elif k > l[mid]:
			s = mid + 1
	return -1

def main():
	for _ in range(int(input())):
		n = int(input())
		l = list(map(int, input().split()))
		l.sort()
		for i in range(2 * n - 1):
			ans = l[i] + l[-1]
			t = l.copy()
			t.pop()
			t.pop(i)
			ll = 2 * n - 3
			m = l[-1]
			f = 1
			while ll > 0:
				mm = m - t[-1]
				m = t.pop()
				ll -= 1
				pos = binary_search(t, ll, mm)
				if pos == -1:
					f = 0
					break
				else:
					t.pop(pos)
					ll -= 1
			if f:
				print('YES')
				print(ans)
				print(l[-1], l[i])
				t = l.copy()
				t.pop(i)
				t.pop()
				ll = 2 * n - 3
				m = l[-1]
				while ll > 0:
					mm = m - t[-1]
					m = t.pop()
					ll -= 1
					pos = binary_search(t, ll, mm)
					print(mm, m)
					t.pop(pos)
					ll -= 1
				break
		if f == 0:
			print('NO')
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')
main()


import os, sys
from io import BytesIO, IOBase
from collections import Counter

def tr(n, a, dct, i):
	dct[a[-1]] -= 1
	dct[a[i]] -= 1
	m = a[-1]
	ini = a[-1] + a[i]
	val = [(a[i], a[-1])]
	for j in range(n - 1, -1, -1):
		if dct[a[j]] < 0:
			return 0
		if not dct[a[j]]:
			continue
		dct[a[j]] -= 1
		if dct[m - a[j]] > 0:
			dct[m - a[j]] -= 1
			val.append((a[j], m - a[j]))
			m = max(m - a[j], a[j])
		else:
			return 0
	return (ini, val)

def main():
	for _ in range(int(input())):
		n = 2 * int(input())
		a = sorted(list(map(int, input().split())))
		fl = 1
		for i in range(n - 1):
			x = tr(n, a, Counter(a), i)
			if x:
				fl = 0
				print('YES')
				print(x[0])
				for j in x[1]:
					print(*j)
				break
		if fl:
			print('NO')
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')
main()


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
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')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=50005, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	done = 0
	for i in range(2 * n - 1):
		d = defaultdict(int)
		c = 0
		for i1 in range(2 * n):
			d[l[i1]] += 1
		su = l[i] + l[-1]
		d[l[i]] -= 1
		d[l[-1]] -= 1
		ans = []
		ans.append((l[i], l[-1]))
		last = l[-1]
		f = 0
		for j in sorted(d, reverse=True):
			while d[j] > 0:
				d[j] -= 1
				if d[last - j] <= 0:
					f = 1
					break
				ans.append((j, last - j))
				d[last - j] -= 1
				last = j
			if f == 1:
				break
		if f == 0:
			done = 1
			print('YES')
			print(su)
			for i in range(n):
				print(*ans[i])
			break
	if done == 0:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input().strip())):
	q = int(input().strip())
	a = list(map(int, input().strip().split(' ')))
	a.sort()
	sa = {}
	for i in a:
		if i not in sa:
			sa[i] = 0
		sa[i] += 1
	movs = []
	for i in a[:-1]:
		sa[i] -= 1
		movs.append(i)
		sa[a[-1]] -= 1
		movs.append(a[-1])
		cl = len(a) - 2
		while cl > -1:
			if sa[a[cl]] != 0:
				if movs[-1] - a[cl] in sa and sa[movs[-1] - a[cl]] > 0:
					sa[movs[-1] - a[cl]] -= 1
					movs.append(movs[-1] - a[cl])
					sa[a[cl]] -= 1
					movs.append(a[cl])
				else:
					while movs:
						sa[movs.pop()] += 1
					break
			else:
				cl -= 1
		if movs:
			break
	else:
		print('NO')
		continue
	print('YES')
	print(movs[0] + movs[1])
	p = 0
	for i in movs:
		if p:
			print(i, p)
			p = 0
		else:
			p = i


import os
from heapq import heapify, heappop, heappush
import sys
import sys, threading
import math
import operator
import bisect
from copy import copy
from collections import defaultdict
from io import BytesIO, IOBase

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

def main():
	for _ in range(int(input())):
		n = int(input())
		n = 2 * n
		ar = inpt()
		ar.sort(reverse=True)
		temp = defaultdict(int)
		for i in ar:
			temp[i] += 1
		temp[ar[0]] -= 1
		if temp[ar[0]] == 0:
			del temp[ar[0]]
		ok = False
		for i in temp.keys():
			if temp[i] == 0:
				continue
			d = defaultdict(int)
			for j in ar:
				d[j] += 1
			d[ar[0]] -= 1
			x = ar[0]
			d[i] -= 1
			ans = [(ar[0], i)]
			for j in range(1, n):
				if ar[j] in d and d[ar[j]] > 0:
					d[ar[j]] -= 1
					if x - ar[j] in d and d[x - ar[j]] > 0:
						d[x - ar[j]] -= 1
						ans.append((ar[j], x - ar[j]))
						x = ar[j]
					else:
						d[ar[j]] += 1
			count = 0
			for j in d.keys():
				count += d[j]
			if count == 0:
				ok = True
				print('YES')
				print(ar[0] + i)
				for (a, b) in ans:
					print(a, b)
				break
		if not ok:
			print('NO')
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')
main()


import os
import io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def sim(arr, i):
	numdict = {}
	for n1 in arr[:-1]:
		numdict[n1] = 0
	for n1 in range(len(arr) - 1):
		numdict[arr[n1]] += 1
	x = arr[-1]
	res = []
	res.append([arr[-1], arr[i]])
	numdict[arr[i]] -= 1
	for u in reversed(range(len(arr) - 1)):
		if u == i or numdict[arr[u]] < 1:
			continue
		b = arr[u]
		if numdict.get(x - b, 0) > 0 and b != x - b or (numdict.get(x - b, 0) > 1 and b == x - b):
			numdict[x - b] -= 1
			numdict[b] -= 1
			res.append([b, x - b])
			x = max(b, x - b)
		else:
			return False
	return res
t = int(input())
for tc in range(t):
	n = int(input())
	arr = [int(z) for z in input().split()]
	arr.sort()
	x = arr[-1]
	ans = 0
	for i in reversed(range(len(arr) - 1)):
		r = sim(arr, i)
		if r != False:
			ans = 1
			print('YES')
			print(arr[i] + arr[-1])
			for j in r:
				print(j[0], j[1])
			break
	if ans == 0:
		print('NO')


import sys
from collections import Counter
input = sys.stdin.buffer.readline
t = int(input())
answers = []
for _ in range(t):
	n = int(input())
	As = sorted(map(int, input().split()))
	cnter_original = Counter(As)
	keys = sorted(set(As))
	ans = []
	for i in range(2 * n - 1):
		cnter = cnter_original.copy()
		x = As[i] + As[-1]
		x_beginning = x
		right = len(keys) - 1
		failed = False
		for _ in range(n):
			while cnter[keys[right]] == 0:
				right -= 1
			A_right = keys[right]
			cnter[A_right] -= 1
			A_left = x - A_right
			if cnter[A_left]:
				cnter[A_left] -= 1
				ans.append((A_left, A_right))
				x = A_right
			else:
				failed = True
				ans.clear()
				break
		if failed:
			continue
		answers.append('YES')
		answers.append(str(x_beginning))
		for (l, r) in ans:
			answers.append(f'{l} {r}')
		break
	else:
		answers.append('NO')
print('\n'.join(answers))


import math
import sys
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
input = sys.stdin.readline
readint = lambda : int(input())
readintm = lambda : map(int, input().strip().split())
readintl = lambda : list(map(int, input().strip().split()))
readfloatm = lambda : map(float, input().strip().split())
readfloatl = lambda : list(map(float, input().strip().split()))
readstr = lambda : input().strip()
readstrl = lambda : list(input().strip())
join = lambda x, l: x.join(map(str, l))
print = lambda *x: sys.stdout.write(' '.join(map(str, x)) + '\n')
printl = lambda l: sys.stdout.write(' '.join(map(str, l)) + '\n')
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
mod = 1000000007
for _ in range(readint()):
	n = readint()
	a = sorted(readintl())
	for exclude in range(2 * n - 1):
		counts = Counter(a)
		counts[a[-1]] -= 1
		counts[a[exclude]] -= 1
		ans = [a[-1], a[exclude]]
		x = a[-1]
		ind = 2 * n - 2
		for i in range(n - 1):
			while counts[a[ind]] == 0:
				ind -= 1
			y = x - a[ind]
			counts[a[ind]] -= 1
			if counts[y] == 0:
				break
			counts[y] -= 1
			ans.append(a[ind])
			ans.append(y)
			x = a[ind]
		else:
			print('YES')
			print(ans[0] + ans[1])
			for i in range(n):
				print(ans[2 * i], ans[2 * i + 1])
			break
	else:
		print('NO')


import sys
input = sys.stdin.readline
a = int(input())
for i in range(a):
	s = int(input())
	ans = []
	z = list(map(int, input().split()))
	z.sort()
	from collections import *
	flag = 0
	reg = 0
	al = defaultdict(list)
	dl = defaultdict(int)
	for i in range(len(z)):
		al[z[i]].append(i)
		dl[i] = 1
	for i in range(len(z) - 2, -1, -1):
		t = z[i]
		ans = []
		ans.append([z[-1], t])
		dl[i] = 0
		dl[len(z) - 1] = 0
		al[z[i]].pop()
		al[z[-1]].pop()
		maxa = z[-1]
		flag = 0
		flag = 0
		for j in range(len(z) - 1, -1, -1):
			if dl[j] == 0:
				continue
			else:
				dl[j] = 0
				if len(al[z[j]]):
					al[z[j]].pop()
				else:
					flag = 1
					break
				q = maxa - z[j]
				if len(al[q]):
					r = al[q].pop()
					dl[r] = 0
					ans.append([q, z[j]])
					maxa = max(z[j], q)
				else:
					flag = 1
					break
			if len(ans) == s:
				break
		if flag == 0 and len(ans) == s:
			print('YES')
			print(sum(ans[0]))
			for i in range(len(ans)):
				print(ans[i][0], ans[i][1])
			reg = 1
			break
		else:
			al = defaultdict(list)
			dl = defaultdict(int)
			for i in range(len(z)):
				dl[i] = 1
				al[z[i]].append(i)
	if reg == 0:
		print('NO')


from __future__ import print_function
from collections import Counter, OrderedDict
from itertools import permutations as perm
from fractions import Fraction
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()

def solve(x, a, b):
	ans = [str(x)]
	while a:
		while a and b[a[-1]] == 0:
			a.pop()
		if a and b.get(x - a[-1]):
			v = x - a[-1]
			b[a[-1]] -= 1
			if b[v]:
				b[v] -= 1
				x = max(a[-1], v)
				ans.append(str(v) + ' ' + str(a.pop()))
			else:
				break
		else:
			break
	return ans
for _ in range(t):
	(n,) = gil()
	a = gil()
	a.sort()
	b = Counter(a)
	ans = []
	for i in range(2 * n - 1):
		ans = solve(a[-1] + a[i], a.copy(), b.copy())
		if len(ans) == n + 1:
			break
	if len(ans) == n + 1:
		print('YES')
		print('\n'.join(ans))
	else:
		print('NO')


from collections import Counter
t = int(input())
for _ in range(0, t, 1):
	n = int(input())
	A = [int(a) for a in input().split()]
	A.sort(reverse=True)
	ans = []
	ok = False
	for i in range(1, len(A), 1):
		sum = 0
		cur = A[0]
		con = Counter()
		sum += A[0] + A[i]
		ans.clear()
		ans.append([A[0], A[i]])
		for j in range(1, len(A), 1):
			con[A[j]] += 1
		con[A[i]] -= 1
		for k in range(1, len(A), 1):
			if not con[A[k]]:
				continue
			con[A[k]] -= 1
			target = cur - A[k]
			if not con[target]:
				break
			con[target] -= 1
			cur = A[k]
			ans.append([target, A[k]])
		check = True
		for k in range(0, len(A), 1):
			if con[A[k]] > 0:
				check = False
				break
		if check == True:
			print('YES \n{}'.format(sum))
			for k in range(0, len(ans), 1):
				print('{} {}'.format(ans[k][0], ans[k][1]))
			ok = True
			break
	if ok == False:
		print('NO')


def ch(a, p):
	s = {}
	for j in range(2 * n):
		s[a[j]] = s.get(a[j], 0) + 1
	s[p] -= 1
	s[a[0]] -= 1
	an = a[0]
	ans = [[a[0], p]]
	for i in range(1, 2 * n):
		if s[a[i]] > 0:
			l = an - a[i]
			s[a[i]] -= 1
			if l in s.keys() and s[l] > 0:
				s[l] -= 1
				an = max(l, a[i])
				ans.append([l, a[i]])
			else:
				return [False, ans]
	return [True, ans]
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = set()
	a.sort(reverse=True)
	flag = 0
	for i in range(1, 2 * n):
		ss = ch(a, a[i])
		if ss[0] == True:
			l = ss[1]
			print('YES')
			print(l[0][0] + l[0][1])
			for j in l:
				print(*j)
			flag = -1
			break
	if flag == 0:
		print('NO')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	A = sorted(map(int, input().split()), reverse=True)
	for k in range(1, 2 * n):
		used = [0] * (2 * n)
		used[0] = used[k] = 1
		cur = A[0]
		ans = [[A[0], A[k]]]
		s = A[0] + A[k]

		def search(x):
			(left, right) = (0, 2 * n - 1)
			while left < right:
				mid = left + (right - left) // 2
				if A[mid] > x or (A[mid] == x and used[mid]):
					left = mid + 1
				else:
					right = mid
			return left
		for i in range(1, 2 * n):
			if used[i]:
				continue
			used[i] = 1
			target = cur - A[i]
			j = search(target)
			if used[j] or A[j] != target:
				break
			used[j] = 1
			ans.append([A[i], A[j]])
			cur = A[i]
		else:
			print('YES')
			print(s)
			for a in ans:
				print(*a)
			break
	else:
		print('NO')


from collections import Counter

def solve(case):
	n = int(input())
	n *= 2
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	for i in range(1, n):
		f = 0
		d = Counter(l)
		t = l[0]
		d[t] -= 1
		d[l[i]] -= 1
		out = [[t, l[i]]]
		for j in range(1, n):
			if i == j:
				continue
			curr = l[j]
			if d[curr] == 0:
				continue
			d[curr] -= 1
			if d[t - curr] <= 0:
				f = 1
				break
			out.append([curr, t - curr])
			d[t - curr] -= 1
			t = curr
		if f == 0:
			break
	if f == 0:
		print('YES')
		print(out[0][0] + out[0][1])
		for i in out:
			print(i[0], i[1])
	else:
		print('NO')
for _ in range(int(input())):
	solve(1)


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if n == 1:
		print('YES')
		print(l[0] + l[1])
		print(l[0], l[1])
		continue
	l1 = []
	l.sort(reverse=True)
	f = -1
	b = l[0]
	for i in range(2 * n - 1, 0, -1):
		if len(l1) == n - 1:
			break
		else:
			l1.clear()
		a = l[0] + l[i]
		f = l[i]
		d = Counter(l)
		d[l[i]] -= 1
		d[b] -= 1
		j = 1
		while j < len(l):
			s = l[j]
			if d[s] >= 1 and d[b - s] >= 1:
				d[s] -= 1
				if d[b - s] >= 1:
					d[b - s] -= 1
				else:
					b = l[0]
					break
				l1.append([s, b - s])
				j += 1
				b = max(s, b - s)
			elif d[s] <= 0:
				j += 1
				continue
			else:
				b = l[0]
				break
	if len(l1) == n - 1:
		print('YES')
		print(l[0] + f)
		print(l[0], f)
		for p in l1:
			print(*p)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	a_set = list(set(a))
	x_list = []
	for i in range(len(a) - 2, -1, -1):
		x_list.append(a[i] + a[-1])
	x_list = list(set(x_list))
	i = 0
	check = 0
	check_list = []
	check_x = 0
	x = 25
	for x in x_list:
		b = a[:]
		y = int(x)
		check_list = []
		while True:
			if len(b) == 0:
				check = 1
				x_check = y
				break
			big = b[-1]
			b.pop()
			if x - big in b:
				check_list.append([big, x - big])
				b.remove(x - big)
				x = big
			else:
				break
		if check == 1:
			break
		i += 1
	if check == 1:
		print('YES')
		print(x_list[i])
		for e in check_list:
			for ee in e:
				print(ee, end=' ')
			print()
	else:
		print('NO')


import sys, os.path
from collections import defaultdict
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())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	ans = []
	f = True
	for i in range(1, len(a)):
		d = defaultdict(int)
		temp = []
		x = a[0]
		ind = 1
		if i == 1:
			ind = 2
		count = len(a) - 2
		for j in range(len(a)):
			d[a[j]] += 1
		d[a[0]] -= 1
		d[a[i]] -= 1
		temp.append(a[0] + a[i])
		temp.append(a[0])
		temp.append(a[i])
		flag = True
		for j in range(ind, len(a)):
			if d[a[j]] != 0:
				if d[x - a[j]] != 0:
					d[a[j]] -= 1
					d[x - a[j]] -= 1
					count -= 2
					temp.append(a[j])
					temp.append(x - a[j])
				else:
					flag = False
					break
				ind = j
				x = a[j]
		if flag and count == 0:
			for j in range(len(temp)):
				ans.append(temp[j])
			f = True
			break
		else:
			f = False
	if f:
		print('YES')
		print(ans[0])
		for i in range(n):
			print(f'{ans[2 * i + 1]} {ans[2 * i + 2]}')
	else:
		print('NO')


import sys
from sys import stdin
import bisect
tt = int(stdin.readline())
ANS = []
for loop in range(tt):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	for nuse in range(2 * n - 1):
		dic = {}
		for i in range(2 * n - 1):
			if a[i] not in dic:
				dic[a[i]] = 0
			dic[a[i]] += 1
			if i == nuse:
				dic[a[i]] -= 1
		ans = [a[-1], a[nuse]]
		ind = 2 * n - 2
		x = a[-1]
		for i in range(n - 1):
			while dic[a[ind]] == 0:
				ind -= 1
			y = x - a[ind]
			dic[a[ind]] -= 1
			if y not in dic or dic[y] == 0:
				break
			ans.append(a[ind])
			ans.append(y)
			dic[y] -= 1
			x = a[ind]
		else:
			print('YES')
			print(ans[0] + ans[1])
			for i in range(n):
				print(ans[2 * i], ans[2 * i + 1])
			break
	else:
		print('NO')


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()
inf = 10 ** 16
md = 10 ** 9 + 7
from collections import Counter

def solve():
	for a in aa[1:]:
		if ac[a] == 0:
			continue
		ac[a] -= 1
		b = ans[-1][-1] - a
		if ac[b] == 0:
			return False
		ac[b] -= 1
		ans.append((b, a))
	return len(ans) == n
for _ in range(II()):
	n = II()
	aa = LI()
	aa.sort(reverse=True)
	ac0 = Counter(aa)
	ac0[aa[0]] -= 1
	for a0 in set(aa):
		ac = ac0.copy()
		ans = [(a0, aa[0])]
		ac[a0] -= 1
		if solve():
			print('YES')
			print(sum(ans[0]))
			for (a, b) in ans:
				print(a, b)
			break
	else:
		print('NO')


from collections import *
from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = sorted(map(int, input().split()))
	d = Counter(l)
	d[l[-1]] -= 1
	ans = []
	s1 = 0
	for i in range(2 * n - 1):
		last = l[-1]
		curr = d.copy()
		curr[l[i]] -= 1
		ans = [f'{l[-1]} {l[i]}']
		s1 = l[i] + last
		for j in range(2 * n - 1, -1, -1):
			if curr[l[j]] > 0:
				val = last - l[j]
				curr[l[j]] -= 1
				if curr[val] > 0:
					ans.append(f'{l[j]} {val}')
					last = l[j]
					curr[val] -= 1
				else:
					break
		if len(ans) == n:
			break
	else:
		print('NO')
	if len(ans) == n:
		print('YES')
		print(s1)
		print('\n'.join(ans))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	n *= 2
	d = {}
	for e in a:
		if e in d:
			d[e] += 1
		else:
			d[e] = 1
	ans = []
	for i in range(n - 2, -1, -1):
		td = d.copy()
		(x, y) = (a[-1], a[i])
		td[x] -= 1
		td[y] -= 1
		ans.append((x, y))
		tmp = a.copy()
		while len(ans) < n // 2:
			while td[tmp[-1]] == 0:
				tmp.pop()
			cmax = tmp[-1]
			td[cmax] -= 1
			if x - cmax in td and td[x - cmax] > 0:
				td[x - cmax] -= 1
				ans.append((cmax, x - cmax))
				x = cmax
			else:
				ans = []
				break
		if ans:
			break
	if ans:
		print('YES')
		print(sum(ans[0]))
		for (x, y) in ans:
			print(x, y)
	else:
		print('NO')


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():

	def check(a, x, ans):
		d = defaultdict(list)
		for i in range(len(a)):
			d[a[i]].append(i)
		for i in a:
			if i in d:
				d[i].pop()
				if not d[i]:
					del d[i]
				y = x - i
				if y not in d:
					return (False, [])
				ans.append([i, y])
				d[y].pop()
				if not d[y]:
					del d[y]
				x = i
		return (True, ans)
	n = inp() * 2
	l = li()
	l.sort(reverse=True)
	for i in range(1, n):
		(a, b) = check(l[1:i] + l[i + 1:], l[0], [])
		if a:
			pr('YES')
			print(l[i] + l[0])
			print(l[i], l[0])
			for i in b:
				print(*i)
			return
	pr('NO')
for _ in range(inp()):
	solve()


from sys import stdin
input = stdin.readline
from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	fixed = a[-1]
	ok = False
	for i in range(2 * n - 1):
		d = defaultdict(int)
		for j in a:
			d[j] += 1
		ans = a[i] + fixed
		x = fixed
		d[a[i]] -= 1
		d[fixed] -= 1
		pairs = [(a[i], fixed)]
		for j in range(2 * n - 2, -1, -1):
			if d[a[j]] and d[x - a[j]]:
				d[a[j]] -= 1
				d[x - a[j]] -= 1
				pairs.append((a[j], x - a[j]))
				x = max(a[j], x - a[j])
		good = True
		for j in d.values():
			if j:
				good = False
				break
		if good:
			print('YES')
			print(ans)
			for i in pairs:
				print(*i)
			ok = True
			break
	if not ok:
		print('NO')


def try_it(n, a, d, idx, pr=False):
	current = {a[-1]: 1, a[idx]: 1}
	mx = 2 * n - 2 if idx != 2 * n - 2 else 2 * n - 3
	x = a[-1]
	if pr:
		print(x + a[idx])
		print(a[-1], a[idx])
	for i in range(n - 1):
		high = a[mx]
		if high in current:
			if d[high] <= current[high]:
				return False
			current[high] += 1
		else:
			current[high] = 1
		lower = x - high
		if lower in d:
			if lower in current:
				if d[lower] - current[lower] > 0:
					current[lower] += 1
				else:
					return False
			else:
				current[lower] = 1
		else:
			return False
		if pr:
			print(lower, high)
		x = high
		if i != n - 2:
			z = 1
			while True:
				des = a[mx - z]
				if des not in current or d[des] > current[des]:
					mx -= z
					break
				z += 1
	return True

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		d = {}
		for i in range(2 * n):
			if a[i] in d:
				d[a[i]] += 1
			else:
				d[a[i]] = 1
		good = False
		for i in range(2 * n - 1):
			if try_it(n, a, d, i):
				good = True
				print('YES')
				try_it(n, a, d, i, True)
				break
		if not good:
			print('NO')
main()


import collections
for _ in range(int(input())):
	n = int(input())
	lijst = list(map(int, input().split()))
	lijst.sort(reverse=True)
	hi = lijst[0]
	flag = False
	dicts = collections.Counter(lijst)
	ans = []
	for x in dicts:
		ans = []
		cur = hi + x
		d = dicts.copy()
		for j in lijst:
			if d[j]:
				d[j] -= 1
				if d[cur - j]:
					ans.append([j, cur - j])
					d[cur - j] -= 1
					cur = j
				else:
					break
		else:
			flag = True
			break
	if flag:
		print('YES')
		print(sum(ans[0]))
		for x in ans:
			print(*x)
	if not flag:
		print('NO')


import os, sys, math
from io import BytesIO, IOBase
from collections import defaultdict, deque, OrderedDict
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

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

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

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

def Sn():
	return input().strip()
BUFSIZE = 8192

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

def check(d, st, end, X):
	d1 = d.copy()
	d1[st] -= 1
	d1[end] -= 1
	if d1[st] == 0:
		d1.pop(st)
	if st != end and d1[end] == 0:
		d1.pop(end)
	ans = [[X], [st, end]]
	X = max(st, end)
	while len(d1):
		z = reversed(d1)
		for x in z:
			mx = x
			break
		if d1.get(X - mx, -1) != -1:
			if X - mx == mx and d1[X - mx] == 1:
				return False
			d1[X - mx] -= 1
			d1[mx] -= 1
			if d1[X - mx] == 0:
				d1.pop(X - mx)
			if X - mx != mx and d1[mx] == 0:
				d1.pop(mx)
			ans.append([X - mx, mx])
			X = mx
		else:
			return False
	yes()
	for x in ans:
		print(*x)
	return True

def solve():
	n = 2 * I()
	l = list(In())
	l.sort()
	d = OrderedDict()
	for x in l:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	ok = False
	for i in range(n - 1):
		if check(d, l[i], l[-1], l[i] + l[-1]):
			ok = True
			break
		if ok:
			break
	if not ok:
		no()
	pass

def main():
	T = I()
	for i in range(T):
		solve()
M = 998244353
P = 1000000007

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()


import sys
from collections import Counter
input = sys.stdin.readline

def arrayDestruct(n, arr):
	arr.sort()
	(ans, x) = ([], 0)
	for i in range(2 * n - 1):
		ans.clear()
		(a, freq) = (arr.copy(), Counter(arr))
		y = a.pop()
		x = y + a[i]
		freq[y] -= 1
		freq[a[i]] -= 1
		ans.append([y, a[i]])
		while True:
			while a and freq[a[-1]] == 0:
				a.pop()
			if not a:
				break
			z = a[-1]
			freq[z] -= 1
			if freq[y - z] == 0:
				break
			else:
				freq[y - z] -= 1
				ans.append([z, y - z])
				y = z
		if len(ans) == n:
			break
	if len(ans) == n:
		print('YES')
		print(x)
		for i in ans:
			print(str(i[0]) + ' ' + str(i[1]))
	else:
		print('NO')

def main():
	for t in range(int(input().strip())):
		(n, a) = (int(input().strip()), [int(i) for i in input().strip().split()])
		arrayDestruct(n, a)
main()


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
from collections import Counter

def gift():
	for _ in range(t):
		N = int(input())
		A = list(map(int, input().split()))
		A.sort()
		C = Counter(A)
		am = max(A)
		for i in range(2 * N - 1):
			Ad = A[:-1]
			Ad.remove(A[i])
			res = [(A[i], am)]
			pp = A[i] + am
			C = Counter(Ad)
			x = am
			for _ in range(N - 1):
				while Ad and C[Ad[-1]] == 0:
					Ad.pop()
				d = Ad.pop()
				C[d] -= 1
				if C[x - d] == 0:
					break
				C[x - d] -= 1
				res.append((d, x - d))
				x = max(d, x - d)
			else:
				yield 'YES'
				yield str(pp)
				for a in res:
					yield ' '.join([str(x) for x in a])
				break
		else:
			yield 'NO'
t = int(input())
ans = gift()
print(*ans, sep='\n')


from sys import stdin, stdout
from collections import Counter
nmbr = lambda : int(stdin.readline())
lst = lambda : list(map(int, stdin.readline().split()))

def fn1(ind):
	vis = {n - 1, ind}
	sm = a[-1]
	d = mp.copy()
	l = [[a[-1], a[ind]]]
	d[a[-1]] = d.get(a[-1], 0) - 1
	d[a[ind]] = d.get(a[ind], 0) - 1
	f1 = 1
	for i in range(n - 2, -1, -1):
		if d.get(a[i], 0) <= 0:
			continue
		req = sm - a[i]
		if req == a[i] and d.get(req) <= 1:
			f1 = 0
			break
		elif d.get(req, 0) > 0:
			sm = a[i]
			d[req] -= 1
			d[a[i]] -= 1
			l += [[a[i], req]]
		else:
			f1 = 0
			break
	if f1:
		print('YES')
		print(a[-1] + a[ind])
		for (k, v) in l:
			print(k, v)
		return True
	return False

def fn(p, v, vis):
	for i in range(p, -1, -1):
		if i not in vis and a[i] == v:
			return i
	return -1
for _ in range(nmbr()):
	n = nmbr()
	n = n * 2
	a = sorted(lst())
	f = 0
	mp = Counter(a)
	for i in range(n - 2, -1, -1):
		if fn1(i):
			f = 1
			break
	if not f:
		print('NO')


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = int(1000000000.0) + 7
MAX = int(200000.0) + 1

def solve():
	n = int(input())
	arr = array()
	arr = sorted(arr, reverse=True)
	n *= 2
	for i in range(1, n):
		x = arr[0] + arr[i]
		m = Counter(arr)
		ans = []
		for j in range(n):
			if arr[j] != x - arr[j] and m[arr[j]] and (x - arr[j] in m) and m[x - arr[j]]:
				ans.append([arr[j], x - arr[j]])
				m[arr[j]] -= 1
				m[x - arr[j]] -= 1
				x = max(arr[j], x - arr[j])
			elif arr[j] == x - arr[j] and m[arr[j]] >= 2:
				ans.append([arr[j], x - arr[j]])
				m[arr[j]] -= 2
				x = max(arr[j], x - arr[j])
		if len(ans) == n // 2:
			print('YES')
			print(arr[0] + arr[i])
			for (x, y) in ans:
				print(x, y)
			return
	print('NO')

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)
primes = [1 for i in range(MAX)]

def sieve():
	global primes
	primes[0] = primes[1] = 0
	i = 2
	while i <= MAX ** 0.5:
		j = i * i
		while primes[i] and j < MAX:
			if j % i == 0:
				primes[j] = 0
			j += i
		i += 1

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

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


import sys
MOD = 1000000007
from collections import Counter

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

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

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

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

def check(arr, x):
	count = Counter(arr)
	i = 0
	l = len(arr)
	res = []
	j = len(arr) - 1
	while i < l:
		while arr[j] not in count:
			j -= 1
		max_val = arr[j]
		another_ele = x - max_val
		if another_ele not in count or (another_ele == max_val and count[max_val] == 1):
			return []
		res.append((another_ele, max_val))
		if count[another_ele] == 1:
			del count[another_ele]
		else:
			count[another_ele] -= 1
		if count[max_val] == 1:
			del count[max_val]
		else:
			count[max_val] -= 1
		x = max_val
		i += 2
	return res

def solve():
	n = get_int()
	arr = list(get_ints())
	arr.sort()
	large = arr[-1]
	for i in range(2 * n - 1):
		res = check(arr, arr[i] + large)
		if len(res):
			print('YES')
			print(res[0][0] + res[0][1])
			for pair in res:
				print(*pair)
			return
	print('NO')
	return
t = get_int()
while t:
	solve()
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a, reverse=True)
	d = {}
	for i in range(len(a)):
		if i == 0 or a[i] != a[i - 1]:
			d[a[i]] = 0
		d[a[i]] += 1
	d[a[0]] -= 1
	f = False
	for i in range(1, len(a)):
		chosen = a[i]
		d1 = {}
		for j in d:
			d1[j] = d[j]
		d1[chosen] -= 1
		pre = a[0]
		flag = True
		ans = 'YES\n' + str(chosen + a[0]) + '\n' + str(a[0]) + ' ' + str(chosen) + '\n'
		for i in range(len(a)):
			if d1[a[i]] == 0:
				continue
			d1[a[i]] -= 1
			temp = pre - a[i]
			if not temp in d1 or d1[temp] == 0:
				flag = False
				break
			ans += str(a[i]) + ' ' + str(temp) + '\n'
			d1[temp] -= 1
			pre = a[i]
		if flag:
			print(ans, end='')
			f = True
			break
	if not f:
		print('NO')


import sys

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

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

def input():
	return sys.stdin.readline().strip()
from collections import defaultdict
import copy
for _ in range(int(input())):
	n = int(input())
	n = 2 * n
	a = get_array()
	a.sort()
	d1 = defaultdict(int)
	for i in range(len(a)):
		d1[a[i]] += 1
	cnt = 0
	for i in range(n - 1):
		x = a[n - 1] + a[i]
		d = copy.copy(d1)
		d[a[n - 1]] -= 1
		d[a[i]] -= 1
		flag = 0
		x = a[n - 1]
		j = n - 2
		c = []
		c.append([a[n - 1], a[i]])
		while j >= 0:
			p = a[j]
			q = x - a[j]
			if d[p] > 0:
				d[p] -= 1
				if d[q] > 0:
					c.append([p, q])
					d[q] -= 1
					x = max(p, q)
				else:
					flag = 1
					break
			j -= 1
		if flag == 0:
			cnt = 1
			print('YES')
			print(a[n - 1] + a[i])
			for i in range(len(c)):
				print(*c[i])
			break
	if cnt == 0:
		print('NO')


def count():
	for i in a:
		try:
			d[i] += 1
		except:
			d[i] = 1

def solve(a):
	for i in a[:len(a) - 1]:
		val = d.copy()
		val[i] -= 1
		v = []
		j = len(a) - 1
		while j > 1:
			s = a[j]
			if val[s]:
				val[s] -= 1
				k = j - 1
				while k >= 0 and val[a[k]] == 0:
					k -= 1
				if k < 0:
					break
				try:
					if val[s - a[k]] > 0 and a[k] != s - a[k] or (val[s - a[k]] > 1 and a[k] == s - a[k]):
						val[s - a[k]] -= 1
						v.append([s - a[k], a[k]])
					else:
						break
				except:
					break
			j -= 1
		if len(v) == n - 1:
			print('YES')
			print(a[-1] + i)
			print(i, a[-1])
			for i in v:
				print(*i)
			return
	print('NO')
for T in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	d = dict()
	count()
	solve(a)


import itertools
import collections
import copy
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 input():
	return sys.stdin.readline().rstrip('\r\n')
mo = int(1000000000.0 + 7)

def exgcd(a, b):
	if not b:
		return (1, 0)
	(y, x) = exgcd(b, a % b)
	y -= a // b * x
	return (x, y)

def getinv(a, m):
	(x, y) = exgcd(a, m)
	return --1 if x == 1 else x % m

def comb(n, b):
	res = 1
	b = min(b, n - b)
	for i in range(b):
		res = res * (n - i) * getinv(i + 1, mo) % mo
	return res % mo
t = int(input())
for _ in range(t):
	n = int(input())
	li = [int(i) for i in input().split()]
	d = {}
	for i in li:
		d[i] = d.get(i, 0) + 1
	li.sort()
	f = True
	for ptr in li:
		ans = []
		f = True
		if ptr == li[-1]:
			x = li[-2] + ptr
		else:
			x = li[-1] + ptr
		srcx = int(x)
		dd = dict(d)
		for cur in li[::-1]:
			while dd[cur]:
				dd[cur] -= 1
				if dd.get(x - cur, 0):
					dd[x - cur] -= 1
					ans.append((x - cur, cur))
					x = max(x - cur, cur)
				else:
					f = False
					break
			if f == False:
				break
		if f:
			ax = ptr
			break
	if f:
		print('YES')
		print(sum(ans[0]))
		for i in ans:
			print(*i)
	else:
		print('NO')


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	a = []
	dic = defaultdict(lambda : 0)
	for el in input().split():
		a.append(int(el))
		dic[int(el)] += 1
	a.sort(reverse=True)
	ans = -1
	for i in range(1, 2 * n):
		x = a[0]
		k = a[i]
		dic_cop = dic.copy()
		j = 1
		dic_cop[k] -= 1
		dic_cop[x] -= 1
		cou = 2
		while j < 2 * n:
			while j < 2 * n and dic_cop[a[j]] <= 0:
				j += 1
			if j >= 2 * n:
				break
			if dic_cop[x - a[j]] > 0:
				if x - a[j] == a[j] and dic_cop[a[j]] < 2:
					break
				dic_cop[x - a[j]] -= 1
				dic_cop[a[j]] -= 1
				cou += 2
				x = a[j]
				j += 1
			else:
				j += 1
		if cou == 2 * n:
			ans = i
			break
	if ans == -1:
		print('NO')
	else:
		print('YES')
		x = a[0]
		k = a[ans]
		print(x + k)
		print(x, k)
		dic[x] -= 1
		dic[k] -= 1
		j = 1
		while j < 2 * n:
			while j < 2 * n and dic[a[j]] <= 0:
				j += 1
			if j >= 2 * n:
				break
			if dic[x - a[j]] > 0:
				print(x - a[j], a[j])
				dic[x - a[j]] -= 1
				x = a[j]
				j += 1
			else:
				j += 1


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
mod = 10 ** 9 + 7
Mod = 998244353
INF = float('inf')
from collections import defaultdict as dd
tc = 1
(tc,) = inp()
for _ in range(tc):
	(n,) = inp()
	a = inp()
	a.sort(reverse=True)

	def check(b, val):
		ans = []
		vis = [False for i in range(len(b))]
		d = dd(list)
		for i in range(len(b)):
			d[b[i]].append(i)
		for key in d.keys():
			d[key] = d[key][::-1]
		i = 0
		while i < len(b):
			if vis[i] == True:
				i += 1
				continue
			tar = b[i]
			rem = val - tar
			idd = d[tar].pop()
			vis[i] = True
			if len(d[rem]) > 0:
				idd = d[rem].pop()
				vis[idd] = True
				val = max(tar, rem)
			else:
				return False
			ans.append([tar, rem])
			i += 1
		return ans
	f = False
	if n > 1:
		lol = a[0]
		a.remove(a[0])
		for i in range(len(a)):
			val = a[i] + lol
			b = a.copy()
			lol1 = a[i]
			b.remove(b[i])
			ans = check(b, lol)
			if ans:
				f = True
				break
		if f:
			print('YES')
			print(val)
			print(lol, lol1)
			for (i, j) in ans:
				print(i, j)
		else:
			print('NO')
	else:
		print('YES')
		print(a[0] + a[1])
		print(a[0], a[1])


t = int(input())

def l_dec(dd, k):
	dd[k] -= 1
	if dd[k] == 0:
		del dd[k]
for _ in range(t):
	n = int(input())
	a = [int(e) for e in input().split()]
	a.sort(reverse=True)
	lp = {}
	for e in a:
		if e in lp:
			lp[e] += 1
		else:
			lp[e] = 1
	inf = False
	for k in range(1, 2 * n):
		l = lp.copy()
		l_dec(l, a[k])
		l_dec(l, a[0])
		p = [[a[0], a[k]]]
		e = a[0]
		for i in range(2 * n):
			j = i + 1
			while j < 2 * n and a[j] not in l:
				j += 1
			if j == 2 * n:
				break
			l_dec(l, a[j])
			ne = e - a[j]
			if ne not in l:
				break
			else:
				l_dec(l, ne)
				p.append([a[j], ne])
			e = a[j]
		if len(l) > 0:
			inf = True
		else:
			inf = False
			break
	if inf:
		print('NO')
	else:
		print('YES')
		print(p[0][0] + p[0][1])
		for e in p:
			print(e[0], e[1])


from collections import Counter

def solve(n, a):
	a.sort(reverse=True)
	mx = a[0]
	flg = False
	cnt = Counter(a)
	for i in cnt:
		if mx == i and cnt[i] == 1:
			continue
		ans = []
		x = mx + i
		c = cnt.copy()
		for j in range(2 * n):
			if c[a[j]]:
				c[a[j]] -= 1
				if c[x - a[j]]:
					ans.append((a[j], x - a[j]))
					c[x - a[j]] -= 1
					x = a[j]
				else:
					break
		else:
			flg = True
			break
	if flg:
		print('YES')
		print(sum(ans[0]))
		for (x, y) in ans:
			print(x, y)
		return
	print('NO')
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	solve(n, a)


import sys, os
import math
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
from io import BytesIO, IOBase

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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

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

def out(var):
	sys.stdout.write(str(var) + '\n')
from collections import Counter
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	idx = 2 * n - 1
	done = False
	for i in range(2 * n - 1):
		m = arr[idx]
		c = Counter(arr[:i] + arr[i + 1:2 * n - 1])
		for j in range(2 * n - 2, -1, -1):
			if c[arr[j]] > 0:
				x = m - arr[j]
				c[arr[j]] -= 1
				if x in c and c[x] > 0:
					c[x] -= 1
					m = arr[j]
				else:
					break
		t = 0
		for k in c:
			t += c[k]
		if t == 0:
			done = True
			break
	if done:
		print('YES')
		print(arr[i] + arr[idx])
		print(arr[i], arr[idx])
		m = arr[idx]
		c = Counter(arr[:i] + arr[i + 1:2 * n - 1])
		for j in range(2 * n - 2, -1, -1):
			if c[arr[j]] > 0:
				x = m - arr[j]
				c[arr[j]] -= 1
				if x in c and c[x] > 0:
					c[x] -= 1
					m = arr[j]
					print(m, x)
				else:
					break
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(d) for d in input().split()]
	a.sort()
	done = 0
	main = 0
	for j in range(len(a) - 2, -1, -1):
		l = []
		count = {}
		for i in a:
			if i in count:
				count[i] += 1
			else:
				count[i] = 1
		curr_sum = a[j] + a[len(a) - 1]
		main = curr_sum
		gone = 2
		l.append([a[j], a[len(a) - 1]])
		count[a[j]] -= 1
		count[a[len(a) - 1]] -= 1
		curr_sum = max(a[j], a[len(a) - 1])
		if j != len(a) - 2:
			k = len(a) - 2
		else:
			k = len(a) - 3
		res = 1
		while gone < 2 * n and res == 1:
			if 0 < count[a[k]]:
				need = curr_sum - a[k]
				count[a[k]] -= 1
				if need in count:
					if count[need] == 0:
						res = 0
					else:
						count[need] -= 1
						l.append([a[k], need])
						curr_sum = max(a[k], need)
						gone += 2
						k = k - 1
				else:
					res = 0
			else:
				k = k - 1
		if res == 1:
			print('YES')
			done = 1
			break
	if done == 1:
		print(main)
		for i in l:
			print(i[0], i[1])
	else:
		print('NO')


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

def go():
	(n,) = ints()
	a = ints()
	ans = solve(n, a)
	if not ans:
		print('NO')
	else:
		print('YES')
		print(sum(ans[0]))
		for (i, j) in ans:
			print(i, j)

def solve(n, a):
	a.sort()
	indices = dict()
	for i in range(2 * n - 1, -1, -1):
		indices[a[i]] = i
	used = [False] * (2 * n)
	res_y = [-1] * n
	res_z = [-1] * n
	for ai in sorted(set(a[:-1])):
		for j in range(2 * n):
			used[j] = False
		ans = simulate(n, a, ai + a[-1], indices, used, res_y, res_z)
		if ans:
			return ans

def simulate(n, a, x, indices, used, res_y, res_z):
	yi = 2 * n - 1
	for t in range(n):
		while yi >= 0 and used[yi]:
			yi -= 1
		if yi < 0:
			return None
		used[yi] = True
		y = a[yi]
		res_y[t] = y
		z = x - y
		if z not in indices:
			return None
		i = indices[z]
		while i < 2 * n and used[i]:
			i += 1
		if i >= 2 * n or a[i] != z:
			return None
		used[i] = True
		res_z[t] = z
		x = max(y, z)
	return list(zip(res_y, res_z))
(num_cases,) = ints()
for case_num in range(num_cases):
	go()


import os
import sys
from io import BytesIO, IOBase
from collections import defaultdict, deque, Counter, OrderedDict
from copy import deepcopy
import threading

def main():
	for _ in range(int(input())):
		n = int(input())
		k = defaultdict(lambda : 0)
		a = sorted([*map(int, input().split())])[::-1]
		for i in range(2 * n):
			k[a[i]] += 1
		for i in range(2 * n):
			k_copy = defaultdict(lambda : 0)
			k_copy[a[0]] += 1
			if k_copy[a[i]] < k[a[i]]:
				k_copy[a[i]] += 1
			else:
				continue
			ans = [a[i] + a[0], [a[i], a[0]]]
			flag = True
			for j in range(2 * n):
				if k_copy[a[j]] >= k[a[j]]:
					continue
				else:
					nx = max(ans[-1]) - a[j]
					k_copy[a[j]] += 1
					if k_copy[nx] < k[nx]:
						k_copy[nx] += 1
						ans.append([a[j], nx])
					else:
						k_copy[a[j]] -= 1
						flag = False
						break
			if flag:
				print('YES')
				print(ans[0])
				for j in range(1, len(ans)):
					print(ans[j][0], ans[j][1])
				break
		else:
			print('NO')
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')
main()


from collections import defaultdict, deque, Counter
import sys
import bisect
import math
input = sys.stdin.readline
mod = 1000000007
t = int(input())
for ii in range(t):
	n = int(input())
	b = [int(i) for i in input().split() if i != '\n']
	b.sort()
	for i in range(2 * n - 2, -1, -1):
		ans = [[b[-1]]]
		(req, maxa) = (b[-1], 2 * n - 2)
		ans[0].append(b[i])
		ind = defaultdict(list)
		for k in range(2 * n - 1):
			ind[b[k]].append(k)
		ind[b[i]].pop()
		while True:
			k = maxa
			while len(ind[b[k]]) == 0 and k != -1:
				k -= 1
			if k == -1:
				break
			maxa = ind[b[k]][-1]
			ind[b[maxa]].pop()
			if len(ind[req - b[maxa]]) == 0:
				break
			ind[req - b[maxa]].pop()
			ans.append([b[maxa], req - b[maxa]])
			req = max(req - b[maxa], b[maxa])
		if len(ans) == n:
			sys.stdout.write('YES' + '\n')
			sys.stdout.write(str(sum(ans[0])) + '\n')
			for j in range(n):
				sys.stdout.write(str(ans[j][0]) + ' ' + str(ans[j][1]) + '\n')
			break
	else:
		sys.stdout.write('NO' + '\n')


from collections import Counter

def seeIfPossible(a, n, initialX):
	counts = Counter(a)
	ans = []
	ok = True
	x = initialX
	r = 2 * n - 1
	for _ in range(n):
		larger = a[r]
		counts[larger] -= 1
		smaller = x - larger
		if counts[smaller] == 0:
			ok = False
			break
		counts[smaller] -= 1
		ans.append([smaller, larger])
		x = larger
		while r > -1 and counts[a[r]] == 0:
			r -= 1
	if ok:
		return ans
	else:
		return -1

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = readIntArr()
		a.sort()
		ok = False
		for i in range(2 * n - 1):
			x = a[-1] + a[i]
			ans = seeIfPossible(a, n, x)
			if ans != -1:
				ok = True
				break
		if ok:
			print('YES')
			print(x)
			multiLineArrayOfArraysPrint(ans)
		else:
			print('NO')
	return
import sys
input = sys.stdin.buffer.readline

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()]
inf = float('inf')
MOD = 10 ** 9 + 7
main()


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
for loop in range(int(fast())):
	n = int(fast())
	a = szzz()
	for nuse in range(2 * n - 1):
		dic = {}
		for i in range(2 * n - 1):
			if a[i] not in dic:
				dic[a[i]] = 0
			dic[a[i]] += 1
			if i == nuse:
				dic[a[i]] -= 1
		ans = [a[-1], a[nuse]]
		ind = 2 * n - 2
		x = a[-1]
		for i in range(n - 1):
			while dic[a[ind]] == 0:
				ind -= 1
			y = x - a[ind]
			dic[a[ind]] -= 1
			if y not in dic or dic[y] == 0:
				break
			ans.append(a[ind])
			ans.append(y)
			dic[y] -= 1
			x = a[ind]
		else:
			print('YES')
			print(ans[0] + ans[1])
			for i in range(n):
				print(ans[2 * i], ans[2 * i + 1])
			break
	else:
		print('NO')


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
from itertools import permutations, combinations

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

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
from fractions import Fraction
INF = float('inf')
mod = 10 ** 9 + 7

def solve(k):
	m = a[0]
	ans = [str(a[0]) + ' ' + str(k)]
	d1 = d.copy()
	d1[k] -= 1
	for i in a[1:]:
		if d1[i]:
			d1[i] -= 1
			if d1[m - i]:
				d1[m - i] -= 1
				ans.append(str(i) + ' ' + str(m - i))
				m = i
			else:
				return -1
	return ans
for t in range(int(data())):
	n = int(data())
	a = sorted(mdata(), reverse=True)
	d = dd(int)
	for i in a:
		d[i] += 1
	d[a[0]] -= 1
	for i in range(1, 2 * n):
		ans = solve(a[i])
		if ans != -1:
			break
	if ans == -1:
		out('NO')
	else:
		out('YES')
		out(a[0] + a[i])
		outl(ans)


from bisect import bisect
from sys import stdin
input = stdin.readline
from collections import Counter

def arraydest(n, a):
	a = sorted(a, reverse=True)
	n = 2 * n
	for i in range(1, n):
		cnt = Counter(a)
		maxi = a[0]
		cnt[maxi] -= 1
		cnt[a[i]] -= 1
		flag = False
		res = [[a[i], maxi]]
		for j in range(1, n):
			if i == j:
				continue
			cur = a[j]
			if cnt[cur] == 0:
				continue
			cnt[cur] -= 1
			if cnt[maxi - cur] == 0:
				flag = True
				break
			cnt[maxi - cur] -= 1
			res.append([cur, maxi - cur])
			maxi = max(cur, maxi - cur)
		if flag == False:
			print('YES')
			print(sum(res[0]))
			for x in res:
				print(*x)
			return ''
	return 'NO'
for i in range(int(input())):
	a = int(input())
	lst = list(map(int, input().strip().split()))
	print(arraydest(a, lst))