You have array of $n$ numbers $a_{1}, a_{2}, \ldots, a_{n}$. 

Rearrange these numbers to satisfy $|a_{1} - a_{2}| \le |a_{2} - a_{3}| \le \ldots \le |a_{n-1} - a_{n}|$, where $|x|$ denotes absolute value of $x$. It's always possible to find such rearrangement.

Note that all numbers in $a$ are not necessarily different. In other words, some numbers of $a$ may be same.

You have to answer independent $t$ test cases.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10^{4}$) — the number of test cases.

The first line of each test case contains single integer $n$ ($3 \le n \le 10^{5}$) — the length of array $a$. It is guaranteed that the sum of values of $n$ over all test cases in the input does not exceed $10^{5}$.

The second line of each test case contains $n$ integers $a_{1}, a_{2}, \ldots, a_{n}$ ($-10^{9} \le a_{i} \le 10^{9}$).


-----Output-----

For each test case, print the rearranged version of array $a$ which satisfies given condition. If there are multiple valid rearrangements, print any of them.


-----Example-----
Input
2
6
5 -2 4 8 6 5
4
8 1 4 2

Output
5 5 4 6 8 -2
1 2 4 8



-----Note-----

In the first test case, after given rearrangement, $|a_{1} - a_{2}| = 0 \le |a_{2} - a_{3}| = 1 \le |a_{3} - a_{4}| = 2 \le |a_{4} - a_{5}| = 2 \le |a_{5} - a_{6}| = 10$. There are other possible answers like "5 4 5 6 -2 8".

In the second test case, after given rearrangement, $|a_{1} - a_{2}| = 1 \le |a_{2} - a_{3}| = 2 \le |a_{3} - a_{4}| = 4$. There are other possible answers like "2 4 8 1".

Source: codeforces | Difficulty: EASY
Tags: Sorting

Constructive algorithms


Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	arr = []
	i = 0
	j = n - 1
	if n % 2 == 0:
		while i <= j:
			arr.append(a[i])
			arr.append(a[j])
			i += 1
			j -= 1
	else:
		while i < j:
			arr.append(a[i])
			arr.append(a[j])
			i += 1
			j -= 1
		arr.append(a[i])
	arr = list(reversed(arr))
	print(*arr)


for _ in range(0, int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = [a[(n - 1) // 2]] if n % 2 else []
	p = n // 2 - 1 if n % 2 == 0 else (n - 1) // 2 - 1
	q = n // 2 if n % 2 == 0 else (n - 1) // 2 + 1
	for k in range(n // 2):
		ans.append(a[p])
		ans.append(a[q])
		p -= 1
		q += 1
	print(*ans)


t = int(input())
while t != 0:
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	output = []
	for i in range(n // 2):
		output.append(arr[n - i - 1])
		output.append(arr[i])
	if n % 2 == 1:
		output.append(arr[n // 2])
	output.reverse()
	print(*output)
	t -= 1


def main():
	inf = 10 ** 10
	for _ in range(int(input())):
		(i, j, r) = (0, int(input()) - 1, [])
		l = sorted(map(int, input().split()))
		while i < j:
			r.append(l[i])
			r.append(l[j])
			i += 1
			j -= 1
		if i == j:
			r.append(l[i])
		print(*r[::-1])
main()


import sys
input = sys.stdin.buffer.readline
t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	(*a,) = map(int, input().split())
	a.sort()
	l = [0] * n
	if n % 2:
		l[0] = a[n // 2]
		i = 1
		for (x, y) in zip(a[:n // 2][::-1], a[n // 2 + 1:]):
			l[i] = x
			i += 1
			l[i] = y
			i += 1
	else:
		i = 0
		for (x, y) in zip(a[:n // 2][::-1], a[n // 2:]):
			l[i] = x
			i += 1
			l[i] = y
			i += 1
	ans.append(' '.join(map(str, l)))
print('\n'.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	pointer_1 = n - 1
	pointer_2 = 0
	arr.sort()
	new_arr = [None for i in range(n)]
	for i in range(n):
		if i % 2:
			new_arr[n - 1 - i] = arr[pointer_2]
			pointer_2 += 1
		else:
			new_arr[n - 1 - i] = arr[pointer_1]
			pointer_1 -= 1
	for element in new_arr:
		print(element, end=' ')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	c = []
	for i in range(n // 2):
		c.append(a[i])
		c.append(a[n - i - 1])
	if n % 2 == 1:
		c.append(a[n // 2])
	c.reverse()
	print(*c)


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

def it():
	return int(input())
from collections import deque
for _ in range(it()):
	n = it()
	l = deque(sorted(list(mp())))
	v = []
	for i in range(n):
		if i & 1:
			v.append(l.popleft())
		else:
			v.append(l.pop())
	v.reverse()
	print(*v)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [0] * n
	p = int(n / 2)
	if n % 2 != 0:
		b[0] = a[p]
		for i in range(1, p + 1):
			b[2 * i - 1] = a[p + i]
			b[2 * i] = a[p - i]
	if n % 2 == 0:
		b[0] = a[p - 1]
		b[1] = a[p]
		for i in range(1, p):
			b[2 * i] = a[p - 1 - i]
			b[2 * i + 1] = a[p + i]
	print(*b)


def solve(n, a):
	a.sort()
	ans = []
	l = 0
	r = n - 1
	i = 0
	while l <= r:
		if i % 2 == 0:
			ans.append(a[l])
			l += 1
		else:
			ans.append(a[r])
			r -= 1
		i += 1
	for i in range(n - 1, -1, -1):
		print(ans[i], end=' ')
	print()
t = int(input())
for test in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	solve(n, a)


t = int(input())
for testcase in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	if len(a) % 2 == 0:
		r = len(a) // 2
		cnt = 1
		for i in range(r - 1, -1, -1):
			print(a[i], end=' ')
			print(a[i + cnt], end=' ')
			cnt += 2
	else:
		r = len(a) // 2
		cnt = 2
		print(a[r], end=' ')
		for i in range(r - 1, -1, -1):
			print(a[i], end=' ')
			print(a[i + cnt], end=' ')
			cnt += 2
	print()


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	liste = list(map(int, sys.stdin.readline().split()))
	liste.sort()
	out = list()
	total = 0
	i1 = 0
	i2 = n - 1
	while total != n:
		if i1 == i2:
			total = n
			out.append(liste[i1])
		else:
			out.append(liste[i1])
			out.append(liste[i2])
			total += 2
			i1 += 1
			i2 -= 1
	for i in range(n - 1):
		print(out[n - 1 - i], end=' ')
	print(out[0])


t = int(input())
for i in range(t):
	n = int(input())
	vec = [int(x) for x in input().split(' ')]
	vec.sort()
	s = n // 2
	if n % 2 == 1:
		print(vec[s], end=' ')
	for j in range(s, 0, -1):
		print(vec[j - 1], vec[n - j], end=' ', sep=' ')
	print()


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	A = []
	for i in range(n // 2):
		A += [a[n - 1 - i], a[i]]
	if n & 1:
		A.append(a[n // 2])
	print(*reversed(A))


from collections import defaultdict
t = int(input())
for x in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	mid = (len(a) - 1) // 2
	i = mid
	j = mid + 1
	while i >= 0 and j < len(a):
		print(a[i], end=' ')
		i -= 1
		print(a[j], end=' ')
		j += 1
	if i == 0:
		print(a[0])
	else:
		print('')


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	li.sort()
	if n % 2 == 0:
		d = []
		for i in range(n // 2):
			d.append(li[i])
			d.append(li[n - 1 - i])
		print(*d[::-1])
	else:
		d = []
		for i in range(n // 2):
			d.append(li[i])
			d.append(li[n - 1 - i])
		d.append(li[n // 2])
		print(*d[::-1])


import sys
input = sys.stdin.readline

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

def inlt():
	return list(map(int, input().split()))
results = []
for t in range(inp()):
	length = inp()
	arr = inlt()
	arr = sorted(arr)
	res = []
	left = 0
	right = length - 1
	while left <= right:
		res.append(arr[right])
		if left != right:
			res.append(arr[left])
		left += 1
		right -= 1
	results.append(res)
for r in results:
	x = ' '.join([str(a) for a in r[::-1]])
	print(x)


n = int(input())
inputs = []
for x in range(n):
	n = int(input())
	inputs.append([int(x) for x in input().split()])

def zigzag(l, n):
	x = []
	c = (0, 1, 0) if n % 2 == 1 else (-1, 0, 1)
	leftIdx = n // 2 + c[0]
	rightIdx = n // 2 + c[1]
	for i in range(n):
		if i % 2 == c[2]:
			left = l[leftIdx]
			x.append(left)
			leftIdx -= 1
		else:
			right = l[rightIdx]
			x.append(right)
			rightIdx += 1
	return x
for x in inputs:
	r = zigzag(sorted(x), len(x))
	print(' '.join((str(x) for x in r)))


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	s = sorted(map(int, input().split()))
	j = (n - 1) // 2
	ans = [s[j]]
	for i in range(1, j + 1):
		(x, y) = (s[j - i], s[j + i])
		ans.append(y)
		ans.append(x)
	if n % 2 == 0:
		ans.append(s[-1])
	print(' '.join(map(str, ans)))


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = [0] * n
	if n % 2 == 0:
		k = n - 1
		for i in range(n // 2):
			ans[k] = l[n - 1 - i]
			k -= 1
			ans[k] = l[i]
			k -= 1
	else:
		k = n - 1
		ans[0] = l[n // 2]
		for i in range(n // 2):
			ans[k] = l[n - 1 - i]
			k -= 1
			ans[k] = l[i]
			k -= 1
	for i in range(n):
		print(ans[i], end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	i = (n - 1) // 2
	j = i + 1
	cnt = 0
	ans = []
	while i >= 0 or j < n:
		if cnt % 2 == 0 and i >= 0:
			ans.append(l[i])
			i -= 1
		elif cnt % 2 == 1 and j < n:
			ans.append(l[j])
			j += 1
		cnt += 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	mid = n // 2
	if n % 2 == 1:
		print(arr[mid], end=' ')
		for i in range(1, mid + 1):
			print(arr[mid + i], end=' ')
			print(arr[mid - i], end=' ')
		print('')
	else:
		mid -= 1
		for i in range(1, mid + 2):
			print(arr[mid - i + 1], end=' ')
			print(arr[mid + i], end=' ')
		print(' ')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = []
	for i in range(n // 2):
		a.append(l[i])
		a.append(l[-1 - i])
	if n % 2 == 1:
		a.append(l[n // 2])
	a.reverse()
	for q in a:
		print(q, end=' ')


from sys import stdin, stdout
input = stdin.readline
from math import *
for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	ans = [0] * n
	for i in range(n // 2):
		ans[2 * i] = ar[-(i + 1)]
		ans[2 * i + 1] = ar[i]
	if n % 2:
		ans[-1] = ar[n // 2]
	ans = ans[::-1]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ret = []
	idx = (n - 1) // 2
	for i in range(n):
		idx += i if i % 2 == 1 else -i
		ret.append(a[idx])
	print(*ret)


n = input()
for i in range(int(n)):
	input()
	arr = input().split()
	arr = list(map(int, arr))
	arr_asc = sorted(arr)
	arr_1 = []
	arr_des = sorted(arr, reverse=True)
	arr_out = []
	flag = 0
	if int(len(arr)) % 2 == 0:
		m = int(len(arr) / 2)
	else:
		flag = 1
		m = int(len(arr) / 2) + 1
	for i in range(m):
		arr_out.append(arr_asc[i])
		if flag == 1:
			if i != m - 1:
				arr_out.append(arr_des[i])
		else:
			arr_out.append(arr_des[i])
	for i in range(len(arr_out) - 1, -1, -1):
		arr_1.append(int(arr_out[i]))
		print(int(arr_out[i]), end=' ')
	if int(n) > 1:
		print('\n')


def some():
	for _ in range(int(input())):
		n = int(input())
		ara = list(map(int, input().split()))
		ara.sort()
		left = 0
		right = n - 1
		ans = []
		while left < right:
			ans.append(ara[left])
			ans.append(ara[right])
			left += 1
			right -= 1
		if left == right:
			ans.append(ara[left])
		ans.reverse()
		ans = ' '.join(map(str, ans))
		print(ans)
some()


outputs = []
for __ in range(int(input())):
	N = int(input())
	if N % 2 == 0:
		loop = N // 2
	else:
		loop = (N + 1) // 2
	N -= 1
	A = [int(num) for num in input().split()]
	if N + 1 < 2:
		outputs.append(A[0])
	else:
		output = []
		A.sort()
		for i in range(loop):
			if N - i > i:
				output.append(str(A[i]))
				output.append(str(A[N - i]))
			else:
				output.append(str(A[i]))
		output.reverse()
		outputs.append(' '.join(output))
for j in outputs:
	print(j)


from math import ceil
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	idx = ceil(n / 2)
	idxj = n // 2
	b = a[::-1]
	i = 0
	j = 0
	ans = []
	while i < idx and j < idxj:
		ans.append(b[i])
		ans.append(a[j])
		i += 1
		j += 1
	while i < idx:
		ans.append(b[i])
		i += 1
	while j < idxj:
		ans.append(a[j])
		j += 1
	print(*ans[::-1])


import sys
input = sys.stdin.buffer.readline
T = int(input())
for iTest in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	out = []
	midPoint = (n - 1) // 2
	for i in range(n):
		if i % 2 == 1:
			out.append(str(a[midPoint + (i + 1) // 2]))
		else:
			out.append(str(a[midPoint - (i + 1) // 2]))
	print(' '.join(out))


from sys import *
from math import *
from bisect import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort()
	if n % 2 == 0:
		j = n // 2 - 1
		k = n // 2
	else:
		j = n // 2
		k = n // 2 + 1
	ans = []
	for i in range(n):
		if j >= 0:
			ans.append(a[j])
			j -= 1
		if k < n:
			ans.append(a[k])
			k += 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	s = 0
	e = n - 1
	l2 = []
	c = True
	while s <= e:
		if c:
			l2.append(l[s])
			s += 1
		else:
			l2.append(l[e])
			e -= 1
		c = not c
	print(' '.join(map(str, l2[::-1])))


import math
n = int(input())
Result = []
for i in range(0, n):
	temp = []
	len_ = int(input())
	List = list(map(int, input().strip().split()))[0:len_]
	List.sort()
	for k in range(0, math.ceil(len_ / 2)):
		if k == len_ - 1 - k:
			temp.append(List[k])
			break
		temp.append(List[k])
		temp.append(List[len_ - 1 - k])
	temp.reverse()
	Result.append(temp)
for i in Result:
	for k in i:
		print(k, end=' ')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = [0] * n
	curr = 0
	last = n - 1
	for i in range(n - 1, -1, -1):
		if i % 2 == 0:
			ans[i] = a[last]
			last -= 1
		else:
			ans[i] = a[curr]
			curr += 1
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	list1 = [int(x) for x in input().split()]
	list1.sort()
	i = 0
	j = n - 1
	list2 = []
	while i < j:
		list2.append(list1[j])
		list2.append(list1[i])
		i += 1
		j -= 1
	if n & 1 == 1:
		list2.append(list1[i])
	list2.reverse()
	for elem in list2:
		print(elem, end=' ')
	print()


from collections import deque

def check(ans):
	ans = list(ans)
	diffs = [abs(b - a) for (a, b) in zip(ans, ans[1:])]
	return diffs == sorted(diffs)
ntc = int(input())
for tc in range(1, ntc + 1):
	n = int(input())
	a = deque(sorted([int(x) for x in input().split()]))
	ans = deque()
	while a:
		if a:
			ans.appendleft(a.popleft())
		if a:
			ans.appendleft(a.pop())
	print(*ans)


for _ in range(0, int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	d = [0] * n
	ct = 0
	if n % 2 != 0:
		d[0] = l[n // 2]
		ct += 1
		for i in range(n // 2 + 1, n):
			d[ct] = l[i]
			d[ct + 1] = l[n - i - 1]
			ct += 2
	else:
		for i in range(n // 2, n):
			d[ct] = l[i]
			d[ct + 1] = l[n - i - 1]
			ct += 2
	s = ''
	for i in d:
		s += str(i) + ' '
	s.strip()
	print(s)


for _ in range(int(input())):
	n = int(input())
	lis = sorted([int(i) for i in input().split()])
	if n % 2 == 0:
		ls = [lis[n // 2 - 1::-1], lis[n // 2:n]]
	else:
		ls = [lis[n // 2::-1], lis[n // 2 + 1:n]]
	ans = [ls[i % 2][i // 2] for i in range(n)]
	print(*ans)


import sys
import math
for _ in range(int(sys.stdin.readline().rstrip())):
	n = int(sys.stdin.readline().rstrip())
	num = list(map(int, sys.stdin.readline().rstrip().split()))
	num.sort()
	re = []
	pv = int(math.ceil(len(num) / 2)) - 1
	sz = 1
	while True:
		if len(num) == len(re):
			break
		re.append(num[pv])
		pv += sz
		sz *= -1
		if sz < 0:
			sz -= 1
		else:
			sz += 1
	for i in re:
		print(i, end=' ')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 != 0:
		c = a.pop(n - 1)
		b = []
		for i in range(n // 2):
			b.append(a[n // 2 + i])
			b.append(a[n // 2 - 1 - i])
		b.append(c)
		print(*b, sep=' ')
	else:
		b = []
		for i in range(n // 2):
			b.append(a[n // 2 - 1 - i])
			b.append(a[n // 2 + i])
		print(*b, sep=' ')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	l.sort()
	if n % 2 == 0:
		(i, j) = (n // 2 - 1, n // 2)
	else:
		(i, j) = (n // 2, n // 2 + 1)
	while i > -1:
		ans.append(l[i])
		if j < n:
			ans.append(l[j])
		i -= 1
		j += 1
	print(*ans)


import heapq
test_cases = int(input())

def handle():
	n = int(input())
	values = sorted([int(s) for s in input().split(' ')])
	if n % 2 == 0:
		right = len(values) // 2
		left = right - 1
	else:
		right = left = len(values) // 2
	result = []
	while right < len(values):
		if not result:
			if n % 2 == 0:
				result.append(values[left])
				result.append(values[right])
			else:
				result.append(values[right])
		else:
			right_first = abs(result[-1] - values[right])
			left_first = abs(result[-1] - values[left])
			if right_first > left_first:
				result.append(values[right])
				result.append(values[left])
			else:
				result.append(values[left])
				result.append(values[right])
		left -= 1
		right += 1
	print(' '.join((str(i) for i in result)))
for _ in range(test_cases):
	handle()


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	ans = []
	temp = 0
	for i in range(n):
		if i == 0:
			ans.append(A[n // 2])
			temp = n // 2
		elif i % 2 == 1:
			ans.append(A[temp - i])
			temp = temp - i
		else:
			ans.append(A[temp + i])
			temp = temp + i
	print(*ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		a = LI()
		r = []
		a = sorted(a)
		b = a[:n // 2][::-1]
		c = a[n // 2:]
		for i in range(n // 2 + 1):
			if len(c) > i:
				r.append(c[i])
			if len(b) > i:
				r.append(b[i])
		rr.append(JA(r, ' '))
	return JA(rr, '\n')
print(main())


T = int(input())
for _ in range(T):
	N = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	mid = N // 2
	if N & 1:
		print(arr[mid], end=' ')
	for i in range(mid):
		print(arr[mid + i + (N & 1)], end=' ')
		print(arr[mid - i - 1], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	x = list(map(int, input().split()))
	x.sort()
	a = int(n / 2)
	j = 1
	s = []
	s.append(x[a])
	if n % 2 == 0:
		while j != int(n / 2):
			s.append(x[a - j])
			s.append(x[a + j])
			j += 1
	else:
		while j <= int(n / 2):
			s.append(x[a - j])
			s.append(x[a + j])
			j += 1
	if n % 2 == 0:
		s.append(x[a - j])
	for j in s:
		print(j, end=' ')
	print()


T = int(input())
for t in range(T):
	n = int(input())
	a = sorted([int(i) for i in input().split()])
	a = sorted(a)
	res = []
	p1 = int(n / 2) - 1
	p2 = int(n / 2)
	while p1 != -1 or p2 != n:
		if p2 != n:
			res.append(a[p2])
			p2 += 1
		if p1 != -1:
			res.append(a[p1])
			p1 -= 1
	res = [str(i) for i in res]
	print(' '.join(res))


from math import ceil, floor
T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 1:
		print(a[n // 2], end=' ')
	r = ceil(n / 2)
	l = floor(n / 2) - 1
	while l >= 0:
		print(a[r], a[l], end=' ')
		l -= 1
		r += 1
	print()


for _ in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	if N & 1 == 0:
		for i in range(N // 2 - 1, -1, -1):
			print(A[i], end=' ')
			print(A[N - 1 - i], end=' ')
		print()
	else:
		print(A[N // 2], end=' ')
		for i in range(N // 2 - 1, -1, -1):
			print(A[i], end=' ')
			print(A[N - 1 - i], end=' ')
		print()


from collections import deque

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		x = []
		b = deque(a)
		while len(b):
			x.append(b.pop())
			if len(b) != 0:
				x.append(b.popleft())
		print(' '.join(list(map(str, x[::-1]))))
main()


import math, sys
from collections import Counter

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

def ls():
	return list(map(int, list(input())))

def la():
	return list(input())

def i():
	return int(input())

def isPrime(n):
	i = 2
	if n == 1:
		return False
	while i <= int(math.sqrt(n)):
		if n % i == 0:
			return False
		i = i + 1
	return True

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = i()
for _ in range(t):
	n = int(input())
	a = li()
	a.sort()
	b = []
	i = 0
	while i >= 0 and i < n // 2:
		b.append(a[i])
		b.append(a[n - i - 1])
		i = i + 1
	if n % 2 != 0:
		b.append(a[i])
	b.reverse()
	print(*b)


def solve(array):
	array.sort()
	mid = (len(array) - 1) // 2
	offset = 1
	solution = [array[mid]]
	while mid - offset >= 0 or mid + offset < len(array):
		if mid + offset < len(array):
			solution.append(array[mid + offset])
		if mid - offset >= 0:
			solution.append(array[mid - offset])
		offset += 1
	return solution
t = int(input())
for i in range(t):
	solution = None
	n = int(input())
	array = [int(x) for x in input().split()]
	print(' '.join([str(x) for x in solve(array)]))


from sys import stdin
input = stdin.readline
import bisect
import math
for xoxo in range(1):
	for _ in range(int(input())):
		n = int(input())
		ans = []
		a = list(map(int, input().split()))
		a.sort()
		k = 1
		if n % 2 == 1:
			k += 1
			ans.append(a[n // 2])
		for i in range(n // 2 - 1, -1, -1):
			ans.append(a[i])
			ans.append(a[i + k])
			k += 2
		print(*ans)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	arr2 = sorted(arr)
	index1 = 0
	index2 = n - 1
	ans = []
	while index1 < index2:
		ans.append(arr2[index1])
		index1 += 1
		ans.append(arr2[index2])
		index2 -= 1
	if index2 == index1:
		ans.append(arr2[index1])
	ans2 = []
	for i in reversed(ans):
		ans2.append(i)
	string = str(ans2[0])
	for i in range(1, n):
		string += ' ' + str(ans2[i])
	print(string)


t = int(input())

def search(arr, si, ei):
	if si == ei:
		if arr[si] >= 0:
			return False
		else:
			return si
	mid = (si + ei) // 2
	if arr[mid] >= 0:
		index = search(arr, si, mid)
	elif arr[mid + 1] >= 0:
		index = mid
	else:
		index = search(arr, mid + 1, ei)
	return index
while t > 0:
	t -= 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	i = 0
	j = n - 1
	ans = []
	while i < j:
		ans.append(arr[j])
		ans.append(arr[i])
		i += 1
		j -= 1
	if n % 2 == 1:
		ans.append(arr[i])
	print(*ans[-1::-1])


from time import time
from random import randint

def getList(string):
	return list(map(int, string.split()))

def makeArray(array):
	array.sort()
	jump = 1
	target = len(array) // 2
	diff_array = [array[target]]
	go_right = False
	while target != (0, len(array) - 1)[len(array) % 2]:
		target += jump if go_right else -jump
		diff_array.append(array[target])
		go_right = not go_right
		jump += 1
	return diff_array

def submit():
	for case in range(int(input())):
		input()
		array = getList(input())
		print(*makeArray(array))

def tryOut():
	start_time = time()
	array = getList('5 -2 4 8 6')
	print(makeArray(array))
	print(f'\nExecution time: {time() - start_time}s')
submit()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().rstrip().split(' ')))
	arr = sorted(arr)
	mid = n // 2 + 1
	left = True
	res = []
	offset = 1
	for i in range(n):
		res.append(str(arr[mid - 1]))
		if left:
			mid = mid - offset
			left = False
		else:
			mid = mid + offset
			left = True
		offset += 1
	print(' '.join(res))


for ii in range(int(input())):
	n = int(input())
	l = [int(i) for i in input().split()]
	x = n // 2
	ans = []
	a = sorted(l)
	for i in range(x + 1):
		if i == 0:
			ans.append(a[x])
		if i != 0 and i != x:
			ans.append(a[x - i])
			ans.append(a[x + i])
		if i == x:
			if n % 2 == 0:
				ans.append(a[0])
			else:
				ans.append(a[0])
				ans.append(a[n - 1])
	print(*ans)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	al = list(map(int, input().split()))
	al.sort()
	ans = []
	ans.append(al[n // 2])
	ans.append(al[n // 2 - 1])
	i = n // 2 - 2
	j = n // 2 + 1
	ok = True
	while i >= 0 or j < n:
		if j < n:
			ans.append(al[j])
			j += 1
		if i >= 0:
			ans.append(al[i])
			i -= 1
	print(' '.join((str(x) for x in ans)))

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


ans = []
for _ in range(int(input())):
	n = int(input())
	u = list(map(int, input().split()))
	u.sort()
	a = []
	if n % 2 == 1:
		a.append(u[n // 2])
	for i in range(n // 2 - 1, -1, -1):
		a.append(u[i])
		a.append(u[-i - 1])
	ans.append(' '.join(map(str, a)))
print('\n'.join(ans))


def RA():
	l = input().split()
	return [int(s) for s in l]

def solve():
	n = int(input())
	arr = RA()
	arr.sort()
	left = arr[:n // 2]
	right = arr[n // 2:]
	ans = []
	ri = 0
	li = len(left) - 1
	for i in range(n):
		if i % 2 == 0:
			ans.append(right[ri])
			ri += 1
		else:
			ans.append(left[li])
			li -= 1
	print(*ans)
t = int(input())
for i in range(t):
	solve()


t = int(input())
l2 = []
for i in range(t):
	n = int(input())
	l1 = [int(a) for a in input().split()]
	l1.sort()
	l3 = []
	j = n - 1
	k = 0
	while k <= j:
		if k != j:
			l3.append(l1[k])
		l3.append(l1[j])
		j -= 1
		k += 1
	l3.reverse()
	l2.append(l3)
for k in range(t):
	for j in range(len(l2[k])):
		print(l2[k][j], end=' ')
	print()


import sys, os, io

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

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import deque
import collections

def main():
	for _ in range(int(input())):
		if os.path.exists('input.txt'):
			sys.stdin = open('input.txt', 'r')
			sys.stdout = open('output.txt', 'w')
		n = ri()
		a = ria()
		a = sorted(a)
		b = []
		mid = (n - 1) // 2
		b.append(a[mid])
		i = 1
		c = 1
		while True:
			b.append(a[mid + i])
			c += 1
			if c == n:
				break
			b.append(a[mid - i])
			c += 1
			if c == n:
				break
			i += 1
		wia(b)

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


def sort(array):
	sorted_array = sorted(array)
	flag = True
	result = []
	while sorted_array:
		result.append(str(sorted_array.pop() if flag else sorted_array.pop(0)))
		flag = not flag
	return reversed(result)
arrays = []
for _ in range(int(input())):
	_ = input()
	array = [int(s) for s in input().split()]
	arrays.append(array)
result = [' '.join(sort(a)) for a in arrays]
print('\n'.join(result))


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	c = list(reversed(a[:n // 2]))
	d = a[n // 2:]
	for i in range(n // 2):
		b.append(d[i])
		b.append(c[i])
	if n & 1:
		b.append(d[-1])
	print(*b)


(t,) = (int(x) for x in input().split())
for _ in range(t):
	(n,) = (int(x) for x in input().split())
	arr = [int(x) for x in input().split()]
	arr.sort()
	sol = []
	i = n - 1
	up = True
	while len(sol) != n:
		sol.append(arr[i])
		if up:
			i = n - i - 1
		else:
			i = n - i - 2
		up = not up
	for x in reversed(sol):
		print(x, end=' ')
	print()


import os, sys
from math import *
t = int(input())
for nc in range(t):
	n = int(input())
	num = [int(x) for x in input().strip().split()]
	num.sort()
	ans = [num[0]]
	(i, j) = (1, n - 1)
	for k in range(n - 1):
		if abs(ans[-1] - num[i]) >= abs(ans[-1] - num[j]):
			ans.append(num[i])
			i += 1
		else:
			ans.append(num[j])
			j -= 1
	print(' '.join([str(x) for x in ans[::-1]]))


for t in range(int(input())):
	n = int(input())
	num = list(map(int, input().split()))
	num.sort()
	final = ''
	for i in range(n):
		final += str(num.pop(len(num) // 2)) + ' '
	print(final)


import sys
for _ in range(int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	i = n // 2 - 1
	if n % 2 == 0:
		while i >= 0:
			print(str(a[i]) + ' ' + str(a[n - 1 - i]), end=' ')
			i -= 1
		print()
	else:
		print(a[n // 2], end=' ')
		while i >= 0:
			print(str(a[i]) + ' ' + str(a[n - 1 - i]), end=' ')
			i -= 1
		print()


t = int(input())
for yguagwu in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	b = []
	for i in range(n):
		if i % 2 == 0:
			b.append(a[-i // 2 - 1])
		else:
			b.append(a[i // 2])
	print(*b[::-1])


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l1 = []
	x = (n + 1) // 2
	for i in range(x):
		if i == x - 1 and n % 2 == 1:
			l1.append(l[i])
		else:
			l1.append(l[i])
			l1.append(l[-(i + 1)])
	print(*l1[::-1])


import math

def is_odd(n):
	return n % 2 == 1

def is_even(n):
	return n % 2 == 0

def sorted_dff(arr):
	_sorted = sorted(arr)
	n = len(arr)
	res = []
	if is_odd(n):
		mid = math.floor(n / 2)
		res.append(_sorted[mid])
		(left, right) = (int(mid - 1), int(mid + 1))
	else:
		(left, right) = (int(n / 2 - 1), int(n / 2))
	while left >= 0:
		res.extend([_sorted[left], _sorted[right]])
		left -= 1
		right += 1
	print(' '.join(map(str, res)))
t = int(input())
while t > 0:
	n = int(input())
	arr = list(map(int, input().split(' ')))
	sorted_dff(arr)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	res = []
	for i in range(n):
		if i % 2 == 0:
			res.append(str(a[i // 2]))
		else:
			res.append(str(a[n - 1 - i // 2]))
	print(' '.join((res[n - 1 - i] for i in range(n))))


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	l = []
	a.sort()
	(i, j) = (0, n - 1)
	while i < j:
		l.append(a[j])
		l.append(a[i])
		i += 1
		j -= 1
	l.reverse()
	if n % 2 == 0:
		for k in range(n):
			print(l[k], end=' ')
	else:
		print(a[n // 2], end=' ')
		for k in range(n - 1):
			print(l[k], end=' ')
	print()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		nums = list(map(int, input().split()))
		nums.sort(reverse=True)
		mid = n // 2
		wait_insert = nums[:mid]
		already = nums[mid:]
		wait_insert.sort()
		ans = []
		for i in range(len(wait_insert)):
			ans.append(already[i])
			ans.append(wait_insert[i])
		if n & 1:
			ans.append(already[-1])
		print(' '.join(map(str, ans)))
main()


list_ans = []
for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	list1.sort()
	list2 = []
	if n % 2 == 0:
		for i in range(n // 2):
			list2.append(list1[n // 2 - i - 1])
			list2.append(list1[n // 2 + i])
	else:
		list2.append(list1[(n - 1) // 2])
		for i in range(1, (n - 1) // 2 + 1):
			list2.append(list1[(n - 1) // 2 - i])
			list2.append(list1[(n - 1) // 2 + i])
	list_ans.append(' '.join(map(str, list2)))
for item in list_ans:
	print(item)


t = int(input())
while t:
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ind = [1]
	for i in range(n - 1):
		if i % 2 == 0:
			ind.append(ind[-1] + n - 1 - i)
		else:
			ind.append(ind[-1] - n + 1 + i)
	ind = ind[::-1]
	for i in ind:
		print(arr[i - 1], end=' ')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	l = []
	i = 0
	for i in range((n + 1) // 2):
		l.append(a[i])
		if i != n - i - 1:
			l.append(a[n - i - 1])
	print(*l[::-1])


t = int(input())
while t > 0:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	m = []
	for i in range(n // 2):
		m.append(l[i])
		m.append(l[n - i - 1])
	if n % 2 != 0:
		m.append(l[n // 2])
	m.reverse()
	print(*m)
	t -= 1


import math
n = int(input())
for i in range(n):
	m = int(input())
	nums = [int(i) for i in input().split()]
	nums.sort()
	low = 0
	high = len(nums) - 1
	inhigh = False
	out = ''
	rightOrderNums = []
	while low <= high:
		if inhigh:
			rightOrderNums.append(nums[high])
			high -= 1
			inhigh = False
		else:
			rightOrderNums.append(nums[low])
			low += 1
			inhigh = True
	rightOrderNums = rightOrderNums[::-1]
	for j in rightOrderNums:
		out += ' ' + str(j)
	print(out[1:])


def solve(a, n):
	a.sort()
	mid = int(n / 2)
	left = a[:mid][::-1]
	if n % 2 == 1:
		right = a[mid + 1:]
	else:
		right = a[mid:]
	if n % 2 == 1:
		print(a[mid], end=' ')
	for i in range(mid):
		print(left[i], end=' ')
		print(right[i], end=' ')
	print('')
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	solve(a, n)


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

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

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

def solve():
	n = ri()
	A = rl()
	A.sort()
	out = []
	out.append(A[n // 2])
	(lo, hi) = (n // 2 - 1, n // 2 + 1)
	while lo >= 0 or hi < n:
		if lo >= 0:
			out.append(A[lo])
			lo -= 1
		if hi < n:
			out.append(A[hi])
			hi += 1
	print(*out)
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


def main():
	d = int(input())
	for i in range(d):
		cc = int(input())
		data = [int(v) for v in input().split()]
		data.sort()
		d = len(data) // 2
		res = [data[d]]
		(i, j) = (d - 1, d + 1)
		while i >= 0 or j < len(data):
			if i >= 0:
				res.append(data[i])
				i -= 1
			if j < len(data):
				res.append(data[j])
				j += 1
		print(' '.join((str(ds) for ds in res)))
main()


import sys
for _ in range(int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	b = [None] * n
	j = n - 1 >> 1
	for i in range(n):
		b[i] = a[j]
		if i & 1 == 0:
			j += i + 1
		else:
			j -= i + 1
	print(*b)


T = int(input())
for t in range(T):
	n = int(input())
	l = list(map(int, input().split()))
	l = sorted(l)
	a = []
	while l:
		a.append(l.pop(0))
		if l:
			a.append(l.pop())
	a = a[::-1]
	print(*a)


from queue import PriorityQueue
tc = int(input())
for i in range(tc):
	size_of_number_list = int(input())
	list_numbers = list(map(int, input().split()))
	list_numbers.sort()
	while list_numbers != []:
		length = len(list_numbers)
		print(list_numbers[length // 2], end=' ')
		list_numbers.pop(length // 2)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	if n % 2 == 0:
		(l, r) = (n // 2 - 1, n // 2)
	else:
		print(a[n // 2], end=' ')
		(l, r) = (n // 2 - 1, n // 2 + 1)
	while l > -1 and r < n:
		print(a[l], a[r], end=' ')
		l -= 1
		r += 1
	print()


t = int(input())
for j in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	(a, b) = (n // 2 - (n + 1) % 2, n // 2 + n % 2)
	for i in range(n):
		if i % 2 == 0:
			print(arr[a], end=' ')
			a -= 1
		else:
			print(arr[b], end=' ')
			b += 1
	print()


n = int(input())
k = []
for e in range(n):
	a = int(input())
	t = list(map(int, input().rstrip().split()))
	t.sort()
	c = int(a / 2)
	for i in range(c):
		k.append(t[c + i])
		k.append(t[c - i - 1])
	if a % 2 == 1:
		k.append(t[a - 1])
	k.append('*')
d = len(k)
q = 0
while q < d:
	if k[q] == '*':
		print()
	else:
		print(k[q], end=' ')
	q = q + 1


def solve(n, ar):
	dp = []
	ar.sort()
	inc = 0
	dec = n - 1
	while inc <= dec:
		dp.append(ar[inc])
		dp.append(ar[dec])
		inc += 1
		dec -= 1
	dp.reverse()
	if n % 2 != 0:
		dp.remove(dp[0])
	print(' '.join(map(str, dp)))
t = int(input())
for _ in range(t):
	n = int(input())
	ar = list(map(int, input().split()))
	solve(n, ar)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	v = []
	for i in range(n // 2):
		v.extend([a[i], a[-1 - i]])
	if n % 2:
		v.append(a[n // 2])
	print(*v[::-1])


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	flag = False
	a = []
	for w in range(1, n):
		if len(a) > 0:
			h = a[-1]
			if h <= abs(l[w] - l[w - 1]):
				flag = False
			else:
				flag = True
				break
		a.append(abs(l[w] - l[w - 1]))
	if flag == False:
		print(*l)
	else:
		l.sort()
		ans = []
		for w in range(len(l)):
			if w == len(l) // 2:
				break
			ans.append(l[-1 - w])
			ans.append(l[w])
		if len(l) % 2 == 1:
			ans.append(l[n // 2])
		ans.reverse()
		print(*ans)


t = int(input())
for i in range(0, t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	mid = n // 2
	low = mid - 1
	high = mid + 1
	ans = []
	ans.append(a[mid])
	f = 0
	while low >= 0 and high < n:
		if f % 2 == 0:
			ans.append(a[low])
			low -= 1
			f += 1
		else:
			ans.append(a[high])
			high += 1
			f += 1
	if low >= 0:
		ans.append(a[0])
	if high <= n - 1:
		ans.append(a[n - 1])
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	if n % 2 == 1:
		print(a[n // 2], end=' ')
		for i in range(1, n // 2 + 1):
			print(a[n // 2 - i], end=' ')
			print(a[n // 2 + i], end=' ')
	else:
		for i in range(1, n // 2 + 1):
			print(a[n // 2 - i], end=' ')
			print(a[n // 2 + i - 1], end=' ')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	k = n // 2
	c = 0
	f = 0
	if n & 1 != 0:
		print(a[n // 2], end=' ')
		f = 1
		c = 1
	k -= 1
	while c < n and (k >= 0 and k < n):
		print(a[k], end=' ')
		if f == 1:
			if c % 2 == 0:
				k = n - k - 2
			else:
				k = n - k - 1
		elif c % 2 != 0:
			k = n - k - 2
		else:
			k = n - k - 1
		c += 1
	print()


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().strip().split()))
	l.sort()
	d = []
	j = 0
	k = len(l) - 1
	while j <= k:
		if j == k:
			d.append(l[j])
		else:
			d.append(l[j])
			d.append(l[k])
		j += 1
		k -= 1
	print(*d[::-1])


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	for i in range(n // 2):
		print(l[n // 2 + i], end=' ')
		print(l[n // 2 - i - 1], end=' ')
	if n % 2 == 1:
		print(l[n - 1])
	else:
		print()


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

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

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

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

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

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

def myceil(x, y):
	return (x + y - 1) // y

def Solution(arr, n):
	arr = sorted(arr)
	res = []
	i = 0
	j = n - 1
	while i < j:
		res.append(arr[j])
		res.append(arr[i])
		i += 1
		j -= 1
	if i == j:
		res.append(arr[i])
	print(*list(reversed(res)))

def main():
	for _ in range(get_int()):
		n = get_int()
		arr = get_ints_in_list()
		Solution(arr, n)
main()


task_number = int(input())
for _ in range(task_number):
	n = int(input())
	array = [int(i) for i in input().split()]
	array.sort()
	result = []
	for index in range(n // 2):
		result.append(array[index])
		result.append(array[-(index + 1)])
	if n % 2 == 1:
		result.append(array[n // 2])
	result.reverse()
	print(' '.join([str(a) for a in result]))


n = int(input())
i = 0
ans = []
for i in range(0, n):
	d = int(input())
	data = []
	dd = input()
	ddd = dd.split()
	for k in range(0, d):
		data.append(int(ddd[k]))
	data.sort()
	data2 = []
	s = ''
	if d % 2 == 0:
		mid = len(data) // 2
		data2.append(data[mid])
		for k in range(1, len(data) // 2):
			data2.append(data[mid - k])
			data2.append(data[mid + k])
		data2.append(data[0])
	else:
		mid = (len(data) - 1) // 2
		data2.append(data[mid])
		for k in range(1, len(data) // 2):
			data2.append(data[mid + k])
			data2.append(data[mid - k])
		data2.append(data[-1])
		data2.append(data[0])
	for s1 in data2:
		s += str(s1) + ' '
	ans.append(s)
for i in range(0, n):
	print(ans[i])


t = int(input())
while t != 0:
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	negative = []
	positive = []
	for val in arr:
		if val < 0:
			negative.append(val)
		else:
			positive.append(val)
	positive.reverse()
	output = []
	len_posi = len(positive)
	len_nega = len(negative)
	max_len = max(len_nega, len_posi)
	index_nag = 0
	index_posi = 0
	total_cnt = 0
	while total_cnt <= n:
		if index_posi < len_posi and index_nag < len_nega:
			output.append(positive[index_posi])
			output.append(negative[index_nag])
			index_nag += 1
			index_posi += 1
			total_cnt += 2
		elif index_posi < len_posi:
			output.append(positive[index_posi])
			total_cnt += 1
			index_posi += 1
			if index_posi <= len_posi - 1:
				output.append(positive[len_posi - 1])
				len_posi -= 1
				total_cnt += 1
		elif index_nag < len_nega:
			output.append(negative[len_nega - 1])
			len_nega -= 1
			total_cnt += 1
			if index_nag <= len_nega - 1:
				output.append(negative[index_nag])
				total_cnt += 1
				index_nag += 1
		else:
			total_cnt += 1
	output.reverse()
	print(*output)
	t -= 1


t = int(input())
for i in range(t):
	a = int(input())
	b = a // 2
	c = 0
	al = sorted(list(map(int, input().split())))
	la = al[:b]
	lb = al[b:]
	for i in range(a):
		if i % 2 == 0:
			print(lb[c], end=' ')
			c += 1
		elif i % 2:
			print(la[-c], end=' ')


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	b = []
	if n % 2 == 0:
		for i in range(n // 2):
			b.append(a[i])
			b.append(a[n - i - 1])
		for i in range(n - 1, -1, -1):
			print(b[i], end=' ')
		print()
	else:
		for i in range(n // 2):
			b.append(a[i])
			b.append(a[n - i - 1])
		b.append(a[n // 2])
		for i in range(n - 1, -1, -1):
			print(b[i], end=' ')
		print()


t = int(input())
for _ in range(t):
	x = int(input())
	x = list(map(int, input().split()))
	x.sort()
	while x:
		mid = len(x) // 2
		print(x[mid], end=' ')
		x.pop(mid)


t = int(input())
for i in range(t):
	n = int(input())
	arr = sorted(list(map(int, input().split())))
	arr2 = []
	last = n - 1
	x = 0
	for i in range(n // 2):
		arr2.append(arr[last])
		arr2.append(arr[i])
		last -= 1
		if i == n // 2 - 1 and n % 2 != 0:
			arr2.append(arr[i + 1])
	for i in reversed(arr2):
		print(i, end=' ')
	print('')


t = int(input())
for i in range(0, t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	ans = [-1] * n
	j = 0
	k = n - 1
	while j <= k:
		if j == k:
			ans.append(a[j])
			break
		else:
			ans.append(a[j])
			ans.append(a[k])
			j += 1
			k -= 1
	ans = ans[::-1]
	for k in range(0, n):
		print(ans[k], end=' ')
	print()


t = int(input())

def calc(line):
	arr = [int(x) for x in line.split()]
	arr.sort()
	n = len(arr)
	order = []
	cur = (n - 1) // 2
	diff = 1
	sign = 1
	for i in range(0, n):
		order.append(cur)
		cur += diff
		diff += sign
		diff *= -1
		sign *= -1
	ans = []
	for i in order:
		ans.append(arr[i])
	return ans
for i in range(0, t):
	n = int(input())
	line = input()
	ans = calc(line)
	for x in ans:
		print(x, end=' ')
	print('\n')


for erioionoerqnrnoreernfvnnkklklfklklkl in range(int(input())):
	k = int(input())
	l = list(map(int, input().split()))
	l.sort()
	if k % 2 == 0:
		k //= 2
		l.insert(k, 0)
	else:
		k //= 2
		print(l[k], end=' ')
	print(*[str(l[k + j]) + ' ' + str(l[k - j]) for j in range(1, len(l) // 2 + 1)])


t = int(input())
for i in range(t):
	n = int(input())
	l = str.split(input(), ' ')
	for i in range(n):
		l[i] = int(l[i])
	l.sort()
	ans = []
	for i in range(n // 2):
		ans.append(l[n - i - 1])
		ans.append(l[i])
	if n % 2 != 0:
		ans.append(l[(n - 1) // 2])
	for i in range(n - 1, 0, -1):
		print(ans[i], end=' ')
	print(ans[0])


repeat = int(input())
for i in range(repeat):
	length = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	if length % 2 == 0:
		for i in range(length // 2):
			print(a[length // 2 - 1 - i], end=' ')
			print(a[length // 2 + i], end=' ')
	else:
		print(a[length // 2], end=' ')
		for i in range(length // 2):
			print(a[length // 2 + 1 + i], end=' ')
			print(a[length // 2 + 1 - i - 2], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	p = []
	i = 0
	j = n - 1
	while i < j:
		p.append(l[j])
		p.append(l[i])
		i += 1
		j -= 1
	if n % 2:
		p.append(l[j])
	p.reverse()
	print(*p)


t = int(input())
for i in range(0, t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	a = [str(x) for x in a]
	if n % 2 == 0:
		x = []
		for j in range(0, n // 2):
			x.append(a[0])
			del a[0]
		y = []
		x.reverse()
		for k in range(0, n // 2):
			y.append(x[k])
			y.append(a[k])
	else:
		x = []
		for j in range(0, n // 2):
			x.append(a[0])
			del a[0]
		y = []
		x.reverse()
		y.append(a[0])
		del a[0]
		for k in range(0, n // 2):
			y.append(x[k])
			y.append(a[k])
	print(*y)


for i in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	b = []
	c = []
	if n & 1:
		b.append(a[n // 2])
		del a[n // 2]
	for i in range(n // 2):
		c.append(a[-1 * i - 1])
		c.append(a[i])
	b.extend(c[::-1])
	for i in b:
		print(i, end=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	p = 1
	i = n - 1
	j = 0
	while len(ans) != n:
		if p:
			ans.append(a[i])
			i -= 1
		else:
			ans.append(a[j])
			j += 1
		p = 1 - p
	ans = ans[::-1]
	print(*ans)


import sys
input = sys.stdin.buffer.readline
from collections import deque as dq
t = int(input())
while t:
	t -= 1
	n = int(input())
	a1 = list(map(int, input().split()))
	a1.sort()
	a = dq(a1)
	b = dq()
	while n:
		t1 = a.pop()
		b.appendleft(t1)
		n -= 1
		if n > 0:
			t2 = a.popleft()
			b.appendleft(t2)
			n -= 1
	print(*b)


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().rstrip().split(' ')))
	l.sort()
	new_l = [0] * n
	for i in range(n // 2):
		new_l[n - 1 - 2 * i] = l[i]
		new_l[n - 2 - 2 * i] = l[n - 1 - i]
	if n % 2:
		new_l[0] = l[n // 2]
	for i in range(n):
		print(new_l[i], end=' ')
	print('')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort(reverse=False)
	if n % 2 != 0:
		i = int(n / 2)
		print(arr[i], end=' ')
		k = 1
		while k <= n / 2:
			print(arr[i - k], end=' ')
			print(arr[i + k], end=' ')
			k += 1
	else:
		i = int(n / 2 - 1)
		j = int(n / 2)
		k = 0
		while k <= i:
			print(arr[i - k], end=' ')
			print(arr[j + k], end=' ')
			k += 1


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2:
		print(a[int(n / 2)])
	x = int(n / 2) - 1
	y = int((n + 1) / 2)
	for k in range(int(n / 2)):
		print(a[x], end=' ')
		print(a[y], end=' ')
		x = x - 1
		y = y + 1
	print()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	final = []
	arr.sort()
	if n % 2 == 0:
		for i in range(n // 2):
			final.append(arr[n - 1 - i])
			final.append(arr[i])
	else:
		for i in range(n // 2):
			final.append(arr[n - 1 - i])
			final.append(arr[i])
		final.append(arr[n // 2])
	final = final[::-1]
	print(*final)


I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	if n % 2:
		ans.append(a[n // 2])
	ans = ans[::-1]
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	half = n // 2 - 1 if n % 2 == 0 else n // 2
	l = half
	r = half + 1
	while l >= 0 or r <= n - 1:
		if l >= 0:
			print(a[l], end=' ')
		if r <= n - 1:
			print(a[r], end=' ')
		l -= 1
		r += 1
	print()


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	idx = []
	c = n // 2
	for i in range(n):
		if i % 2 == 0:
			c += i
		else:
			c -= i
		idx.append(c)
		ans.append(arr[c])
	print(*ans)


for t in range(int(input())):
	n = int(input())
	l = [int(i) for i in input().split()]
	l.sort()
	if n % 2 == 0:
		(L, R) = (n // 2 - 1, n // 2)
	else:
		(L, R) = (n // 2, n // 2)
	while L != -1 and R < n:
		print(l[L], end=' ')
		if L != R:
			print(l[R], end=' ')
		(L, R) = (L - 1, R + 1)
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	while i < n // 2:
		arr.append(arr[i])
		arr.append(arr[n - 1 - i])
		i += 1
	if n % 2:
		arr.append(arr[n // 2])
	arr = arr[n:]
	print(*arr[::-1])


for i in range(0, int(input())):
	input()
	d = [int(f) for f in input().split()]
	d.sort()
	ans = []
	k = (len(d) + 1) // 2
	for i in range(0, len(d)):
		if i & 1 == 1:
			print(d[k + i - 1], end=' ')
			k += i
		else:
			print(d[k - i - 1], end=' ')
			k -= i


def solve(n, a):
	a.sort()
	result = []
	(l, r) = (0, n - 1)
	while l < r:
		result.append(a[r])
		result.append(a[l])
		l += 1
		r -= 1
	if n % 2:
		result.append(a[l])
	result = list(result[::-1])
	return ' '.join(map(str, result))
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	result = solve(n, a)
	print(result)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	res = []
	j = n - 1
	for i in range(n // 2):
		res += [a[i]]
		res += [a[j]]
		j -= 1
	if n % 2 == 1:
		res += [a[n // 2]]
	res.reverse()
	print(*res)


from math import ceil
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	x = ceil((n - 1) / 2)
	mx = x
	mn = x
	while x >= 0 and x < n:
		print(a[x], end=' ')
		mx = x
		x = mn - 1
		if x >= 0:
			print(a[x], end=' ')
			mn = x
			x = mx + 1
	print()


N = int(input())
while N:
	N -= 1
	n = int(input())
	b = []
	a = input().split()
	for i in range(n):
		a[i] = int(a[i])
		b.append(0)
	list.sort(a)
	t = 0
	j = n - 1
	i = 0
	while 1:
		b[t] = a[j]
		t += 1
		j -= 1
		if j + 1 == i:
			break
		b[t] = a[i]
		t += 1
		i += 1
		if j == i - 1:
			break
	for i in range(t - 1, -1, -1):
		print(b[i], end=' ')
	print()


import sys
input = sys.stdin.readline

def main():
	test = int(input())
	for _ in range(test):
		n = int(input())
		ara = [int(num) for num in input().split()]
		ara.sort()
		ans = []
		left = 0
		right = n - 1
		while left < right:
			ans.append(ara[left])
			ans.append(ara[right])
			left += 1
			right -= 1
		if left == right:
			ans.append(ara[left])
		ans.reverse()
		ans = ' '.join(map(str, ans))
		print(ans)
main()


a = int(input())
for i in range(a):
	v = int(input())
	l = list(map(int, input().split()))
	l.sort()
	g = []
	for (i, j) in zip(range(0, len(l)), range(len(l) - 1, -1, -1)):
		if i + 1 == j:
			g.append(l[i])
			g.append(l[j])
			break
		elif i == j:
			g.append(l[i])
			break
		else:
			g.append(l[i])
			g.append(l[j])
	g.reverse()
	for u in g:
		print(u, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	print(a[n // 2], end=' ')
	d = n // 2 - 1
	r = 2
	for i in range(n - 1):
		print(a[d], end=' ')
		if r % 2 == 0:
			d += r
		else:
			d -= r
		r += 1
	print()


import sys
t = int(sys.stdin.readline().rstrip())

def main():
	for _ in range(t):
		n = int(sys.stdin.readline().rstrip())
		(*a,) = map(int, sys.stdin.readline().split())
		a.sort()
		i = n // 2
		b = [a[i]]
		for j in range(1, n):
			i += -j if j & 1 else j
			b.append(a[i])
		print(*b)
main()


for _ in range(int(input())):
	n = int(input())
	a = input().split(' ')
	for i in range(n):
		a[i] = int(a[i])
	a.sort()
	b = [0] * n
	for i in range(n // 2):
		b[2 * i] = a[i]
		b[2 * i + 1] = a[-i - 1]
	if n % 2 == 1:
		b[n - 1] = a[n // 2]
	for i in range(n):
		print(b[n - i - 1], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	l = []
	for i in range(n // 2):
		l.append(a[i])
		l.append(a[n - i - 1])
	if n % 2 == 1:
		l.append(a[n // 2])
	for i in range(n - 1, -1, -1):
		print(l[i], end=' ')
	print()


cases = int(input())
for t in range(cases):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	s = []
	v = n // 2
	if n % 2 == 1:
		v += 1
	for i in range(v):
		if i == n - 1 - i:
			s.append(a[i])
		else:
			s.append(a[n - i - 1])
			s.append(a[i])
	s = s[::-1]
	print(*s)


def sorted(L):
	n = len(L)
	L.sort()
	init = [L[0]]
	i = 1
	while i < n:
		if i % 2 == 0:
			init += [L[i // 2]]
			i += 1
		else:
			init += [L[n - 1 - i // 2]]
			i += 1
	else:
		init.reverse()
		return init
n = int(input())
for i in range(n):
	n1 = int(input())
	arrray = list(map(int, input().rstrip().split()))
	array = sorted(arrray)
	print(' '.join(map(str, array)))


a = int(input())
for i in range(a):
	r = int(input())
	z = list(map(int, input().split()))
	z.sort()
	ans = z[::-1]
	gan = []
	k = 0
	i = 0
	j = 0
	while len(gan) != len(z):
		if k % 2 == 0:
			gan.append(z[i])
			i += 1
		else:
			gan.append(ans[j])
			j += 1
		k += 1
	print(' '.join(map(str, gan[::-1])))


import sys
T = int(input())
for _ in range(T):
	N = int(input())
	a = sorted(map(int, input().split()))
	M_IDX = N // 2 + (0 if N % 2 else -1)
	M = a[M_IDX]
	res = [M]
	i = 1
	while len(res) < N:
		if M_IDX + i < N:
			res.append(a[M_IDX + i])
		if M_IDX - i >= 0:
			res.append(a[M_IDX - i])
		i += 1
	print(*res)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	a1 = a[:n // 2 + n % 2]
	a2 = a[:n // 2 + n % 2 - 1:-1]
	b = [str(a1[i]) + ' ' + str(a2[i]) for i in range(n // 2)]
	if n % 2 == 1:
		b.append(a1[-1])
	print(*b[::-1])


q = int(input())
for _ in range(q):
	n = int(input())
	v = list(sorted(map(int, input().split())))
	res = list()
	for i in range(int(n / 2)):
		res.append(v[i])
		res.append(v[-i - 1])
	if n % 2 == 1:
		res.append(v[int(n / 2)])
	res.reverse()
	print(*res)


import math
t = int(input())
while t:
	t = t - 1
	n = int(input())
	a = [int(s) for s in input().split()]
	a.sort()
	ans = []
	dif = []
	s = int(math.ceil(n / 2) - 1)
	ans.append(a[s])
	r = s + 1
	l = s - 1
	while r <= n - 1 and l >= 0:
		ans.append(a[r])
		ans.append(a[l])
		r = r + 1
		l = l - 1
	if r == n - 1:
		ans.append(a[r])
	for i in ans:
		print(i, end=' ')
	print()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import deque
for _ in range(int(input())):
	n = int(input())
	a = deque(sorted(list(map(int, input().split()))))
	b = [0] * n
	(b[-1], b[-2]) = (a[0], a[-1])
	a.popleft()
	a.pop()
	cnt = -3
	total = 2
	while a:
		b[cnt] = a.popleft()
		cnt -= 1
		if a:
			b[cnt] = a.pop()
			cnt -= 1
	print(' '.join((str(k) for k in b)))


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	a.sort()
	if n % 2 == 1:
		ans.append(a[n // 2])
	for i in range(n // 2 - 1, -1, -1):
		ans.append(a[i])
		ans.append(a[-1 - i])
	print(*ans, sep=' ')


t = int(input())
for i in range(0, t):
	n = int(input())
	a = input().split(' ')
	for j in range(0, n):
		a[j] = int(a[j])
	a.sort()
	b = []
	c = 0
	for x in range(0, n // 2):
		b.append(a[c])
		b.append(a[n - c - 1])
		c += 1
	if n % 2 == 1:
		b.append(a[n // 2])
	b.reverse()
	for x in range(0, n):
		print(b[x], end=' ')
	print()


import math
t = int(input())
for i in range(t):
	n = int(input())
	l1 = list(map(int, input().split()))
	l1.sort()
	l2 = []
	for i in l1:
		l2.append(i)
	l2.reverse()
	i = 0
	count1 = math.ceil(n / 2) - 1
	count2 = n // 2 - 1
	l3 = []
	while i < n:
		if i % 2 == 0:
			l3.append(l1[count1])
			count1 = count1 - 1
			i += 1
		else:
			l3.append(l2[count2])
			count2 = count2 - 1
			i += 1
	for j in l3:
		print(j, end=' ')
	print()


import sys
import collections

def main():
	for t in range(int(input())):
		n = int(input())
		v = list(map(int, input().split()))
		v.sort()
		ans = list()
		if n & 1:
			i = n // 2 - 1
			j = n // 2 + 1
			ans.append(v[n // 2])
			while i >= 0:
				ans.append(v[j])
				ans.append(v[i])
				i -= 1
				j += 1
		else:
			i = n // 2 - 1
			j = n // 2
			while i >= 0:
				ans.append(v[j])
				ans.append(v[i])
				i -= 1
				j += 1
		ans = list(map(lambda a: str(a), ans))
		ans = ' '.join(ans)
		print(ans)
main()


t = int(input(''))
for _ in range(t):
	n = int(input(''))
	a = list(map(int, input('').split(' ')))
	a.sort()
	ans = [0] * n
	j = n - 1
	i = 0
	while j >= 0:
		ans[j] = a[i]
		i = i + 1
		j = j - 2
	j = n - 2
	i = n - 1
	while j >= 0:
		ans[j] = a[i]
		i = i - 1
		j = j - 2
	for h in ans:
		print(h, end=' ')
	print('')


t = int(input())
for i in range(t):
	n = int(input())
	z = list(map(int, input().split()))
	z = sorted(z)[::-1]
	ans = []
	p = z[:(n + 1) // 2]
	q = z[(n + 1) // 2:][::-1]
	j = 0
	k = 0
	pn = len(p)
	qn = len(q)
	while j < pn and k < qn:
		ans.append(p[j])
		ans.append(q[k])
		j += 1
		k += 1
	while j < pn:
		ans.append(p[j])
		j += 1
	while k < qn:
		ans.append(q[k])
		k += 1
	print(*ans[::-1])


def main():
	for _ in range(int(input())):
		n = int(input())
		array = list(map(int, input().split()))
		array.sort()
		low = 0
		high = n - 1
		result = list()
		while low < high:
			result.append(array[low])
			result.append(array[high])
			low += 1
			high -= 1
		if low == high:
			result.append(array[low])
		result.reverse()
		print(*result)
main()


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

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

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

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

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	arr = l()
	arr.sort()
	d = deque()
	for i in range(n):
		d.append(arr[i])
	answer = []
	for i in range(n):
		if i & 1:
			answer.append(d.pop())
		else:
			answer.append(d.popleft())
	answer = answer[::-1]
	print(*answer)


t = int(input())
for tt in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	sa = sorted(a)
	i = 1
	j = 1
	b = [sa[0]]
	while n - j >= i:
		b.append(sa[-1 * j])
		b.append(sa[i])
		i += 1
		j += 1
	if len(b) != n:
		b.pop()
	b.reverse()
	for i in range(n - 1):
		print(b[i], end=' ')
	print(b[-1])


n = int(input())
for _ in range(n):
	input()
	c = sorted(list(map(int, input().split())))
	output = []
	if len(c) <= 2:
		print(' '.join(list(map(str, c))))
		continue
	(a, b) = (c.pop(0), c.pop(-1))
	if abs(a - c[-1]) > abs(b - c[0]):
		output.append(b)
		output.append(a)
	else:
		output.append(a)
		output.append(b)
	while len(c):
		if abs(c[0] - output[-1]) > abs(c[-1] - output[-1]):
			output.append(c[0])
			c.pop(0)
		else:
			output.append(c[-1])
			c.pop(-1)
	print(' '.join(list(map(str, output[::-1]))))


t = int(input())
while t:
	n = int(input())
	a = input().split()
	a = [int(x) for x in a]
	a.sort()
	b = []
	(i, j) = (0, n - 1)
	while i < j:
		b.append(a[i])
		b.append(a[j])
		i += 1
		j -= 1
	if i == j:
		b.append(a[i])
	for i in range(n - 1, -1, -1):
		print(b[i], end=' ')
	print()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	l = []
	i = 0
	while len(l) < n:
		l.append(a[i])
		l.append(a[n - i - 1])
		i += 1
	if len(l) > n:
		del l[len(l) - 1]
	l.reverse()
	print(*l)


def solve(n, A):
	A.sort()
	m = n // 2
	res = [A[m]]
	if n % 2 == 0:
		for i in range(1, n):
			if i % 2 == 1:
				m -= i
			else:
				m += i
			res.append(A[m])
	else:
		for i in range(1, n):
			if i % 2 == 1:
				m += i
			else:
				m -= i
			res.append(A[m])
	return res
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	print(*solve(n, A))


for _ in range(int(input())):
	n = int(input())
	data = [int(x) for x in input().split()]
	data.sort()
	if n % 2 == 0:
		for q in range(n // 2 - 1, -1, -1):
			print(data[q], data[n - 1 - q], end=' ')
		print()
	else:
		print(data[n // 2], end=' ')
		for q in range(n // 2 - 1, -1, -1):
			print(data[q], data[n - 1 - q], end=' ')
		print()


from math import ceil
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	diff = list(zip(ar[n // 2:n], reversed(ar[0:n // 2])))
	for i in range(len(diff)):
		print(diff[i][0], diff[i][1], end=' ')
	if n % 2 == 0:
		print()
	else:
		print(ar[n - 1])


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	if n % 2 == 0:
		for i in range(n // 2):
			ans.append(a[i])
			ans.append(a[n - i - 1])
	else:
		for i in range(n // 2):
			ans.append(a[i])
			ans.append(a[n - i - 1])
		ans.append(a[n // 2])
	ans.reverse()
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	ans = []
	for i in range(int(n / 2)):
		ans.append(a[i])
		ans.append(a[n - 1 - i])
	if n % 2 == 1:
		ans.append(a[int(n / 2)])
	ans.reverse()
	for i in ans:
		print(i, end=' ')
	print()


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

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

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	a = sorted(int_array())
	ans = []
	j = 0
	k = n - 1
	for i in range(n):
		if i % 2 == 0:
			ans.append(a[j])
			j += 1
		else:
			ans.append(a[k])
			k -= 1
	ans = ans[::-1]
	print(*ans)


t = int(input())

def check(ans):
	if len(ans) < 3:
		return True
	diff = abs(ans[1] - ans[0])
	for i in range(2, len(ans)):
		x = abs(ans[i] - ans[i - 1])
		if x < diff:
			return False
		diff = x
	return True
for _ in range(t):
	n = int(input())
	A = sorted(list(map(int, input().split())))
	B = [(A[i], A[-i - 1]) for i in range(n // 2 - 1, -1, -1)]
	answer = []
	if n % 2 != 0:
		answer.append(A[n // 2])
	for (x, y) in B:
		answer.extend((x, y))
	print(' '.join(map(str, answer)))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	if n % 2 == 0:
		for j in range(int(n / 2)):
			if j != n - j - 1:
				ans.append(l[j])
				ans.append(l[n - j - 1])
			else:
				ans.append(l[j])
	elif n % 2 == 1:
		for j in range(int(n / 2) + 1):
			if j != n - j - 1:
				ans.append(l[j])
				ans.append(l[n - j - 1])
			else:
				ans.append(l[j])
	t = list(ans[::-1])
	print(*t)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	idx = n // 2
	print(a[idx], end=' ')
	for x in range(1, idx + 1):
		if idx - x >= 0:
			print(a[idx - x], end=' ')
		if idx + x < n:
			print(a[idx + x], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	if n == 1:
		print(a[0])
		continue
	if n == 2:
		print(a[0], a[1])
		continue
	l = (n - 1) // 2
	r = (n - 1) // 2 + 1
	a.sort()
	b = []
	for i in range(n):
		if i % 2 == 0:
			b.append(a[l])
			l -= 1
		else:
			b.append(a[r])
			r += 1
	for c in b:
		print(c, end=' ')
	print()


n = int(input())
for i in range(n):
	k = int(input())
	xs = map(int, input().split())
	xs = sorted(xs)
	sign = 1
	res = []
	for i in range(k):
		res.append(xs[int((i + 1) / 2) * sign])
		sign *= -1
	print(' '.join(map(str, reversed(res))))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split(' ')]
	arr.sort()
	res = []
	temp = []
	for i in range(n // 2):
		res.append(arr[i])
		res.append(arr[n - 1 - i])
	if n % 2 == 1:
		res.append(arr[n // 2])
	for i in range(n - 1, -1, -1):
		print(res[i], end=' ')
	print()


def solve_odd_sorted(a):
	n = len(a)
	assert n % 2 == 1
	median_pos = n // 2
	up_first = abs(a[median_pos + 1] - a[median_pos]) < abs(a[median_pos - 1] - a[median_pos])
	res = [a[median_pos]]
	if not up_first:
		for i in range(1, n // 2 + 1):
			res.append(a[median_pos - i])
			res.append(a[median_pos + i])
	else:
		for i in range(1, n // 2 + 1):
			res.append(a[median_pos + i])
			res.append(a[median_pos - i])
	return res

def solve(a):
	n = len(a)
	a = sorted(a)
	if n % 2 == 1:
		median = a[n // 2]
	else:
		median = (a[n // 2 - 1] + a[n // 2]) / 2
	if len(a) % 2 == 1:
		return solve_odd_sorted(a)
	return solve_odd_sorted(a[:n // 2] + [median] + a[n // 2:])[1:]

def main():
	T = int(input())
	for _ in range(T):
		n = int(input())
		a = list(map(int, input().split()))
		print(' '.join(map(str, solve(a))))
main()


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = [l[n // 2]]
	i = 1
	while len(a) != n:
		a.append(l[n // 2 - i])
		if n // 2 + i == n:
			break
		a.append(l[n // 2 + i])
		i += 1
	print(*a)
for _ in range(int(input())):
	solution()


import math

def main():
	for q in range(int(input())):
		N = int(input())
		l = list(map(int, input().split()))
		l.sort()
		mid = len(l) // 2
		left = mid - 1
		while left != -1 or mid != N:
			if mid != N:
				print(l[mid], end=' ')
				mid += 1
			if left != -1:
				print(l[left], end=' ')
				left -= 1
		print('')
main()


def main():
	for _ in range(int(input())):
		(n, l) = (int(input()), sorted(map(int, input().split())))
		r = [0] * n
		m = n // 2
		r[::2] = l[m:]
		r[1::2] = l[m - n - 1::-1]
		print(' '.join(map(str, r)))
main()


t = int(input())
for q in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	while len(arr) > 0:
		print(arr.pop(len(arr) // 2), end=' ')


import sys

def log(*argv):
	pass
log = print

def read_str():
	return input()

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

def read_str_list():
	return input().strip().split(' ')

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

def read_lines(n, read_func):
	return [read_func() for _ in range(n)]

def list_to_str(l, sep=' '):
	return sep.join(map(str, l))

def main():
	T = read_int()
	for case_idx in range(1, T + 1):
		ans = solve_case()
		print('{}'.format(ans))

def solve_case():
	N = read_int()
	nums = read_int_list()
	nums.sort()
	ans = []
	for i in range(N):
		if i % 2 == 0:
			ans.append(nums[(N - 1) // 2 - i // 2])
		else:
			ans.append(nums[(N - 1) // 2 + i // 2 + 1])
	return list_to_str(ans)
sys.setrecursionlimit(1000000)
main()


from bisect import bisect_left as lower_bound, bisect_right as upper_bound
from sys import stdin, stdout
from collections import defaultdict

def solve(arr, n):
	pass

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(stdin.readline())
		arr = list(map(int, stdin.readline().strip().split()))
		arr.sort()
		if n & 1:
			(i, j) = (n // 2, n // 2 + 1)
		else:
			(i, j) = (n // 2 - 1, n // 2)
		ret = [-1 for _ in range(n)]
		k = 0
		while i >= 0 or j < n:
			ret[k] = arr[i]
			k += 1
			if j < n:
				ret[k] = arr[j]
				k += 1
			i -= 1
			j += 1
		stdout.write(' '.join(list(map(str, ret))) + '\n')
main()


from collections import deque
from math import ceil
t = int(input())
while t != 0:
	(n, l) = (int(input()), list(map(int, input().strip().split())))
	l.sort()
	(d, length) = (deque(), int(ceil(len(l) / 2)))
	for i in range(0, length):
		if i == n - i - 1:
			d.appendleft(l[i])
		else:
			(d.appendleft(l[n - i - 1]), d.appendleft(l[i]))
	print(*d, sep=' ')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	li = sorted(list(map(int, input().split())))
	if n % 2:
		print(li[(n - 1) // 2], end=' ')
		li2 = li[(n - 1) // 2 + 1:]
		li = li[:(n - 1) // 2][::-1]
		for i in range(len(li)):
			print(li2[i], li[i], end=' ')
		print()
	else:
		li2 = li[n // 2:]
		li = li[:n // 2][::-1]
		for i in range(len(li)):
			print(li[i], li2[i], end=' ')
		print()


from sys import stdin, stdout

def f(a, n):
	a.sort()
	i = n - 1
	j = 0
	b = []
	while j < i:
		b.append(a[i])
		b.append(a[j])
		i -= 1
		j += 1
	if n % 2 == 1:
		b.append(a[j])
	b = b[::-1]
	print(*b)
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	f(a, n)


from math import ceil
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	m = ceil(n / 2) - 1
	i = m - 1
	j = m + 1
	ans = [l[m]]
	sign = 1
	a = 1
	while m + a * sign != -1 and m + a * sign != n:
		m = m + a * sign
		ans += [l[m]]
		sign *= -1
		a += 1
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	while len(arr) > 0:
		print(arr.pop(len(arr) // 2), end=' ')
	print()


from collections import Counter, defaultdict
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = [0] * n
	l = 0
	r = n - 1
	for i in range(n - 1, -1, -1):
		if i % 2 == 0:
			ans[i] = a[l]
			l += 1
		else:
			ans[i] = a[r]
			r -= 1
	print(*ans)


import sys

def answer(n, a):
	lst = []
	a.sort()
	for i in range(n // 2):
		lst.append(a[i])
		lst.append(a[n - i - 1])
	if n % 2 == 1:
		lst.append(a[n // 2])
	lst.reverse()
	return lst

def main():
	t = int(input())
	while t:
		n = int(input())
		a = [int(i) for i in sys.stdin.readline().split()]
		print(' '.join(map(str, answer(n, a))))
		t -= 1
	return
main()


import sys
input = sys.stdin.buffer.readline
T = int(input())
for _ in range(1, T + 1):
	n = int(input())
	numbers = [int(x) for x in input().split()]
	numbers.sort()
	answer = []
	j = 0
	while len(answer) < n:
		answer.append(numbers[j])
		if len(answer) < n:
			answer.append(numbers[n - j - 1])
		j += 1
	print(*answer[::-1])


t = int(input())
while t > 0:
	n = int(input())
	a = [int(n) for n in input().split()]
	a.sort()
	result = []
	mid = len(a) // 2
	if len(a) % 2 == 0:
		for i in range(0, mid):
			result.append(a[mid - (i + 1)])
			result.append(a[mid + i])
	else:
		for i in range(0, mid + 1):
			if i == 0:
				result.append(a[mid])
			else:
				result.append(a[mid + i])
				result.append(a[mid - i])
	for i in result:
		print(i, end=' ')
	t -= 1


from collections import deque
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().strip().split()))
	a.sort()
	l = deque([])
	if n % 2 != 0:
		print(a[n // 2], end=' ')
	for i in range(n // 2):
		l.appendleft(a[i])
		l.appendleft(a[n - 1 - i])
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	L = list(map(int, input().split()))
	L.sort()
	L1 = []
	for j in range(n // 2):
		L1.append(L[j])
		L1.append(L[-j - 1])
	if n % 2 != 0:
		L1.append(L[n // 2])
	L1.reverse()
	for x in L1:
		print(x, end=' ')
	print('\n')


from sys import exit
from collections import deque

def i():
	return input()

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

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

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

def print_array(a):
	print(' '.join(map(str, a)))
t = ii()
for _ in range(t):
	n = ii()
	a = deque(sorted(liis()))
	ans = []
	bol = True
	for i in range(n):
		if bol:
			ans.append(a.popleft())
		else:
			ans.append(a.pop())
		bol = not bol
	ans = ans[::-1]
	print_array(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	swaps = n // 2
	a.sort()
	d = [a[0], a[-1]]
	for i in range(1, swaps):
		if abs(d[-1] - a[i]) >= abs(d[-1] - a[n - i - 1]):
			d.append(a[i])
			d.append(a[n - i - 1])
		else:
			d.append(a[n - i - 1])
			d.append(a[i])
	if n % 2 == 1:
		t = a[swaps]
		if abs(d[-1] - t) > abs(d[-2] - t):
			d.append(t)
		else:
			d = d[:-1] + [t] + [d[-1]]
	d = d[::-1]
	s = ' '.join(map(str, d))
	print(s)


t = int(input())
for test in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort(reverse=True)
	ans = []
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	if n % 2 == 0:
		for i in range(n - 1, -1, -1):
			print(ans[i], end=' ')
		print()
	else:
		ans.append(a[n // 2])
		for i in range(n - 1, -1, -1):
			print(ans[i], end=' ')
		print()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l1 = []
	if n % 2 != 0:
		l1.append(l[n // 2])
	for j in range(1, n // 2 + 1):
		if n % 2 == 0:
			l1.append(l[n // 2 + j - 1])
			l1.append(l[n // 2 - j])
		else:
			l1.append(l[n // 2 + j])
			l1.append(l[n // 2 - j])
	for j in l1:
		print(j, end=' ')
	print()


from sys import stdin
for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, stdin.readline().split()))
	res = []
	(c, d) = divmod(n, 2)
	for i in range(c):
		res.append(a[i])
		res.append(a[n - i - 1])
	if d > 0:
		res.append(a[c])
	print(*reversed(res))


import math
from collections import Counter
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()

def s(a):
	print(' '.join(list(map(str, a))))
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	l = []
	a.sort()
	for i in range(n // 2):
		l.append(a[n - i - 1])
		l.append(a[i])
	if n % 2 == 1:
		l.append(a[n // 2])
	l.reverse()
	print(*l)


import sys
input = sys.stdin.readline
from collections import *
from math import *
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	r = [0 for i in range(n)]
	c = n - 1
	for i in range(n // 2):
		r[c] = a[i]
		r[c - 1] = a[n - i - 1]
		c -= 2
	if n % 2:
		r[0] = a[n // 2]
	print(*r)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	newArr = []
	for i in range(n // 2):
		newArr.append(arr[i])
		newArr.append(arr[n - i - 1])
	if n % 2 == 1:
		newArr.append(arr[n // 2])
	print(*newArr[::-1])


from sys import stdin
input = lambda : stdin.readline().strip()
lin = lambda : list(map(int, input().split()))
iin = lambda : int(input())
muin = lambda : map(int, input().split())
from math import ceil, sqrt, factorial
from collections import deque
from bisect import bisect_left

def solve():
	n = iin()
	l = lin()
	l = deque(sorted(l))
	ans = []
	for i in range(n):
		if i % 2 == 0:
			ans.append(l.pop())
		else:
			ans.append(l.popleft())
	ans.reverse()
	print(*ans)
qwe = 1
qwe = int(input())
for _ in range(qwe):
	solve()


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


t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		print(a[int(n / 2 - 1)], a[int(n / 2)], end=' ')
		for i in range(1, int(n / 2)):
			if n / 2 - i - 1 >= 0:
				print(a[int(n / 2 - i - 1)], end=' ')
			if n / 2 + i < n:
				print(a[int(n / 2 + i)], end=' ')
	else:
		print(a[int(n / 2)], end=' ')
		for i in range(1, int(n / 2) + 1):
			if n / 2 - i >= 0:
				print(a[int(n / 2 - i)], end=' ')
			if n / 2 + i < n:
				print(a[int(n / 2 + i)], end=' ')
	print()
	t = t - 1


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

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	for i in range(n // 2):
		b.append(a[n - i - 1])
		b.append(a[i])
	if n % 2 != 0:
		b.append(a[n // 2])
	b.reverse()
	print(*b)

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


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	arr.sort()
	while arr:
		print(arr.pop(len(arr) // 2), end=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = 0
	r = n - 1
	b = []
	while l < r:
		b.append(a[l])
		b.append(a[r])
		l += 1
		r -= 1
	if l == r:
		b.append(a[l])
	print(*b[::-1])


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	a = []
	for i in range(n // 2 - 1, -1, -1):
		a.append(arr[i])
		a.append(arr[n - 1 - i])
	if n % 2 == 0:
		print(*a)
	else:
		a.insert(0, arr[n // 2])
		print(*a)


t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	b = [0] * n
	y = 0
	for x in range(n // 2):
		b[y] = a[x]
		b[y + 1] = a[-x - 1]
		y += 2
	if n % 2:
		b[y] = a[n // 2]
	for x in range(n - 1, -1, -1):
		print(b[x], end=' ')
	print()
	t -= 1


testcases = int(input())
while testcases:
	testcases -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	while arr:
		print(arr.pop(len(arr) // 2), end=' ')
	print('')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	sortedA = sorted(a)
	ans = [0] * n
	i = 0
	j = n - 1
	idx = n - 1
	while i <= j:
		ans[idx] = sortedA[j]
		idx -= 1
		if i != j:
			ans[idx] = sortedA[i]
			idx -= 1
		i += 1
		j -= 1
	print(*ans)


import sys

def calculate_case():
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	out = []
	if n % 2 != 0:
		out.append(str(a[n // 2]))
	left = (n - 2) // 2
	right = (n + 1) // 2
	while left >= 0:
		out.append(str(a[left]))
		out.append(str(a[right]))
		left -= 1
		right += 1
	sys.stdout.write(' '.join(out) + '\n')
test_cases = int(input())
for i in range(1, test_cases + 1):
	calculate_case()


from math import ceil, inf
import sys

def pro(arr):
	n = len(arr)
	lst = sorted(arr)
	ans = [0] * n
	i = 0
	j = n - 1
	k = n - 1
	while i < j:
		ans[k] = lst[j]
		k -= 1
		ans[k] = lst[i]
		k -= 1
		i += 1
		j -= 1
	if n % 2:
		ans[0] = lst[n // 2]
	print(*ans)
t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	pro(lst)


import math
t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		c = n // 2
		print(a[c - 1], a[c], end=' ')
		n = n // 2 - 1
		d = c - 1
	else:
		c = n // 2
		print(a[c], end=' ')
		n = n // 2
		d = c
	for i in range(0, n):
		print(a[d - (i + 1)], a[c + (i + 1)], end=' ')
	print()
	t -= 1


for t in range(int(input())):
	n = int(input())
	A = sorted(list(map(int, input().split())))
	ans = []
	for i in range(n // 2):
		ans.append(A[i])
		ans.append(A[n - 1 - i])
	if n % 2:
		ans.append(A[n // 2])
	print(*ans[::-1])


import sys
input = sys.stdin.readline
INF = 2 ** 62 - 1

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

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

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

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

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

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def slv(N, A):
	A.sort()
	ans = []
	c = N // 2
	for i in range(N):
		if i % 2 == 0:
			s = 1
		else:
			s = -1
		ans.append(A[c + (i + 1) // 2 * s])
	return ans

def main():
	T = read_int()
	for _ in range(T):
		N = read_int()
		A = read_int_n()
		print(*slv(N, A))
main()


import sys
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	idx = n // 2
	sign = 1
	for i in range(n):
		print(a[idx], end=' ')
		idx -= sign * (i + 1)
		sign *= -1
	print()


def main():
	tc_count = int(input())
	for tc in range(tc_count):
		n = int(input())
		lst = list(map(int, input().split()))
		lst = sorted(lst)
		sol = []
		printed = 0
		l = 0
		r = len(lst) - 1
		while printed < len(lst):
			sol.append(lst[l])
			l += 1
			printed += 1
			if printed >= len(lst):
				break
			sol.append(lst[r])
			r -= 1
			printed += 1
		print(*sol[::-1])
main()


t = int(input())
for i in range(0, t):
	n = int(input())
	a = [int(z) for z in input().split()]
	a.sort()
	f = 0
	res = []
	m = n // 2
	l = m - 1
	h = m + 1
	res.append(a[m])
	while l >= 0 and h < n:
		if f % 2 == 0:
			res.append(a[l])
			l = l - 1
			f = f + 1
		else:
			res.append(a[h])
			h = h + 1
			f = f + 1
	if h <= n - 1:
		res.append(a[n - 1])
	if l >= 0:
		res.append(a[0])
	print(*res)


import sys
input = sys.stdin.readline
(t,) = map(int, input().split())
for _ in range(t):
	N = int(input())
	X = list(map(int, input().split()))
	X.sort()
	Y = [0] * N
	(l, r) = (0, N - 1)
	for i in range(N - 1, -1, -1):
		if i % 2:
			Y[i] = X[r]
			r -= 1
		else:
			Y[i] = X[l]
			l += 1
	print(*Y)


t = int(input())

def Sorting_function(A):
	A.sort()
	if n % 2 == 1:
		print(A[n // 2], end=' ')
	for i in range(n // 2)[::-1]:
		print(A[i], A[n - 1 - i], end=' ')
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	Sorting_function(A)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [a.pop(0 if i % 2 else -1) for i in range(n)]
	b.reverse()
	print(*b)


from math import ceil, gcd
from math import factorial as fact, comb as ncr
from math import sqrt
from bisect import bisect_left as bl
from bisect import bisect_right as br
from array import array
from collections import Counter as ctr
from collections import deque as dq

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

def arr(a):
	return array('i', a)

def solve():
	for _ in range(int(input())):
		n = int(input())
		a = li()
		a.sort()
		j = n // 2
		i = j - 1
		while i >= 0 and j < n:
			print(a[j], end=' ')
			j += 1
			print(a[i], end=' ')
			i -= 1
		if n % 2:
			print(a[-1])
		else:
			print()
solve()


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l1 = [0] * n
	if n % 2 == 0:
		a = n // 2
		b = n // 2 + 1
		for i in range(n // 2):
			l1[2 * i] = l[a - 1]
			l1[2 * i + 1] = l[b - 1]
			a -= 1
			b += 1
	else:
		a = n // 2 + 1
		b = n // 2 + 1
		l1[0] = l[a - 1]
		for i in range(n // 2):
			l1[2 * i + 1] = l[a - 2]
			l1[2 * i + 2] = l[b]
			a -= 1
			b += 1
	for i in range(n):
		print(l1[i], end=' ')
	print()


t = int(input())
for x in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	rarr = []
	for i in range(n // 2):
		rarr += [arr[n - i - 1], arr[i]]
	if n % 2 == 1:
		rarr += [arr[n // 2]]
	for i in range(1, n + 1):
		print(rarr[n - i], end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	j = n - 1
	ls = []
	while i < j:
		ls.append(arr[j])
		ls.append(arr[i])
		i += 1
		j -= 1
	if i == j:
		ls.append(arr[i])
	for i in range(n - 1, -1, -1):
		print(ls[i], end=' ')
	print()


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

def query(n, A):
	idx = n // 2
	Ans = [A[idx]]
	for i in range(1, n):
		if i % 2 == 1:
			idx -= i
			Ans.append(A[idx])
		else:
			idx += i
			Ans.append(A[idx])
	return Ans

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		A = list(map(int, input().split()))
		A.sort()
		Ans = query(n, A)
		sys.stdout.write(' '.join(map(str, Ans)) + '\n')
main()


n1 = int(input())
for j in range(n1):
	n = int(input())
	a = list(map(int, input().strip().split()))[:n]
	b = [0] * n
	min = 0
	max = n - 1
	a = sorted(a)
	for i in range(n):
		if i % 2 == 0:
			b[n - 1 - i] = a[min]
			min += 1
		if i % 2 == 1:
			b[n - 1 - i] = a[max]
			max -= 1
	for i in range(n):
		print(b[i], end=' ')
	print('')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	while a != []:
		print(a[len(a) // 2], end=' ')
		a.pop(len(a) // 2)


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	temp = []
	i = 0
	j = n - 1
	while i < n / 2:
		temp.append(lst[i])
		temp.append(lst[j])
		i += 1
		j -= 1
	if n % 2 != 0:
		temp.append(lst[i])
	for i in range(n - 1, -1, -1):
		print(temp[i], end=' ')
	print()


T = int(input())
for _ in range(T):
	n = int(input())
	arr = [int(x) for x in input().split()]
	diff = [0] * n
	arr.sort()
	index = n - 1
	for i in range(n // 2):
		diff[index] = arr[n - i - 1]
		index -= 1
		diff[index] = arr[i]
		index -= 1
	if n % 2 != 0:
		diff[index] = arr[n // 2]
	print(*diff, sep=' ')


tc = int(input())
for _ in range(tc):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	res = []
	if n % 2 == 0:
		spl = lst[:n // 2]
		spl = spl[::-1]
		spr = lst[n // 2:]
	else:
		spl = lst[:n // 2]
		spl = spl[::-1]
		spr = lst[n // 2 + 1:]
		res.append(lst[n // 2])
	for i in range(n // 2):
		res.append(min(spl[i], spr[i]))
		res.append(max(spl[i], spr[i]))
	for i in res:
		print(i, end=' ')
	print()


tc = int(input())
for i in range(tc):
	n = input()
	nums = list(map(int, input().split(' ')))
	nums.sort()
	out = []
	p1 = len(nums) // 2 - 1 if len(nums) % 2 == 0 else len(nums) // 2
	p2 = p1 + 1
	while p1 >= 0:
		out.append(str(nums[p1]))
		if p2 < len(nums):
			out.append(str(nums[p2]))
		p1 -= 1
		p2 += 1
	print(' '.join(out))


t = int(input())
for q in range(0, t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	for i in range(0, n // 2):
		b.append(a[i])
		b.append(a[n - i - 1])
	if n % 2 != 0:
		b.append(a[n // 2])
	b.reverse()
	print(*b)


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = sorted(list(map(int, input().split())))
	if n == 1:
		print(*a)
		continue
	if n & 1:
		print(a[n // 2], end=' ')
		j = n // 2 + 1
		i = j - 2
		while i >= 0 and j < n:
			print(a[i], a[j], end=' ')
			i -= 1
			j += 1
		print()
	else:
		j = n // 2
		i = j - 1
		while i >= 0 and j < n:
			print(a[i], a[j], end=' ')
			i -= 1
			j += 1
		print()


t = int(input())
for ti in range(t):
	n = int(input())
	ll = [int(i) for i in input().split(' ')]
	ll.sort()
	if len(ll) % 2 == 1:
		print(ll[len(ll) // 2], end=' ')
	for i in range(len(ll) // 2):
		print(ll[len(ll) // 2 - 1 - i], end=' ')
		print(ll[len(ll) - len(ll) // 2 + i], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	mid = n // 2
	for i in range(n):
		mid += i if i % 2 == 0 else -i
		ans.append(a[mid])
	print(*ans)


def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		b = []
		if n % 2:
			b.append(a[n // 2])
		i = n // 2 - 1
		while i >= 0:
			b.append(a[i])
			b.append(a[n - 1 - i])
			i -= 1
		print(*b)
main()


from collections import Counter as C, defaultdict as D, deque as Q
from operator import itemgetter as I
from itertools import product as P
from bisect import bisect_left as BL, bisect_right as BR
from heapq import heappush as HPUSH, heappop as HPOP
from math import floor as MF, ceil as MC, gcd as MG, factorial as F, sqrt as SQRT, inf as INFINITY, log as LOG
from sys import stdin, stdout
INPUT = stdin.readline
PRINT = stdout.write

def player1():
	print('')

def player2():
	print('')

def isPrime(n):
	for i in range(2, MC(SQRT(n)) + 1):
		if n % i == 0:
			return False
	return True

def factors(x):
	ans = []
	for i in range(1, MC(SQRT(x)) + 1):
		if x % i == 0:
			ans.append(i)
			if x % (x // i) == 0:
				ans.append(x // i)
	return ans

def main():
	for _ in range(int(INPUT())):
		n = int(input())
		a = sorted(map(int, INPUT().split()))
		mid = n // 2
		PRINT(str(a[mid]) + ' ')
		diff = 1
		while diff + mid < n and mid - diff >= 0:
			PRINT(str(a[mid - diff]) + ' ' + str(a[mid + diff]) + ' ')
			diff += 1
		if not n & 1:
			PRINT(str(a[0]) + '\n')
main()


for i in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	if n % 2 != 0:
		b = n // 2
		for j in range(1, b + 1):
			if j == 1:
				print(a[b], a[b + 1], a[b - 1], end=' ')
			else:
				print(a[b + j], a[b - j], end=' ')
	else:
		b = n // 2 - 1
		for j in range(1, b + 1):
			if j == 1:
				print(a[b], a[b + 1], a[b - 1], end=' ')
			else:
				print(a[b + j], a[b - j], end=' ')
		print(a[-1])


for _ in range(int(input())):
	n = int(input())
	ls = sorted(list(map(int, input().split())))
	res = []
	for i in range(n // 2):
		res.append(ls[i])
		res.append(ls[n - i - 1])
	if n % 2:
		res.append(ls[n // 2])
	res = res[::-1]
	print(*res)


t = int(input())
for q in range(t):
	n = int(input())
	mas = list(map(int, input().split()))
	mas.sort()
	if n % 2 == 0:
		l = n // 2 - 1
		r = n // 2
		for i in range(n // 2):
			print(mas[l], mas[r], end=' ')
			l -= 1
			r += 1
		print()
	else:
		print(mas[n // 2], end=' ')
		l = n // 2 - 1
		r = n // 2 + 1
		for i in range(n // 2):
			print(mas[l], mas[r], end=' ')
			l -= 1
			r += 1
		print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		init = int(n / 2 - 1)
	else:
		init = int(n // 2)
	f = 0
	for i in range(n):
		if f == 0:
			init -= i
			print(str(a[init]), end=' ')
			f = 1
		else:
			init += i
			print(str(a[init]), end=' ')
			f = 0
	print('')


from collections import deque
t = int(input())
while t:
	n = int(input())
	nl = list(map(int, input().split()))
	nl.sort()
	nl = deque(nl)
	ans = []
	while nl:
		if nl:
			ans.append(nl.popleft())
		if nl:
			ans.append(nl.pop())
	ans = ans[::-1]
	for i in ans:
		print(i, end=' ')
	print()
	t -= 1


t = int(input())
for q in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	if n % 2 == 0:
		for i in range(n // 2):
			ans.append(arr[n - i - 1])
			ans.append(arr[i])
	else:
		for i in range(n // 2):
			ans.append(arr[n - i - 1])
			ans.append(arr[i])
		ans.append(arr[n // 2])
	for k in range(len(ans) - 1, -1, -1):
		print(ans[k], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	res = []
	if n % 2 == 0:
		for i in range(n // 2 - 1, -1, -1):
			res.extend([lst[i], lst[~i]])
	else:
		res.append(lst[n // 2])
		for i in range(n // 2 - 1, -1, -1):
			res.extend([lst[i], lst[~i]])
	print(*res)


for _ in range(int(input())):
	input()
	a = sorted(map(int, input().split()))
	left = a[:len(a) // 2]
	right = a[len(a) // 2 + len(a) % 2:]
	if len(a) % 2 == 1:
		print(a[len(a) // 2], end=' ')
	for i in range(len(a) // 2):
		print(left[-i - 1], right[i], end=' ')
	print()


numcases = int(input())

def solve():
	newlist = []
	a.sort()
	for i in range(alength):
		if i > alength - i - 1:
			return newlist
		if i == alength - i - 1:
			newlist.append(a[i])
			return newlist
		newlist.append(a[i])
		newlist.append(a[alength - 1 - i])
for n in range(numcases):
	alength = int(input())
	a = list(map(int, input().split(' ')))
	newlist = solve()
	print(*newlist[::-1])


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	if n % 2 == 0:
		(start1, end1) = (n // 2, n // 2 + 1)
		while start1 >= 1:
			ans.append((start1, end1))
			end1 += 1
			start1 -= 1
	else:
		(start1, end1) = (n // 2 + 1, n // 2)
		while end1 >= 1:
			ans.append((start1, end1))
			start1 += 1
			end1 -= 1
	for i in range(len(ans)):
		print(a[ans[i][0] - 1], end=' ')
		print(a[ans[i][1] - 1], end=' ')
	if n % 2 == 1:
		print(a[n - 1], end='')
	print()


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = [int(x) for x in stdin.readline().split()]
	a.sort()
	p = 0
	q = n - 1
	ans = list()
	while p < q:
		ans.append(a[p])
		ans.append(a[q])
		p = p + 1
		q = q - 1
	if p == q:
		ans.append(a[p])
	ans.reverse()
	print(*ans)


t = int(input())
for q in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l = sorted(l)
	u = [0] * n
	if n % 2 == 0:
		v = int(n / 2) - 1
		for i in range(n):
			v += pow(-1, i + 1) * i
			u[i] = l[v]
	else:
		v = int((n + 1) / 2) - 1
		for i in range(n):
			v += pow(-1, i + 1) * i
			u[i] = l[v]
	r = ''
	for i in range(len(u) - 1):
		r += str(u[i]) + ' '
	r += str(u[len(u) - 1])
	print(r)


t = int(input())
for i in range(t):
	n = int(input())
	l = input().split()
	for x in range(n):
		l[x] = int(l[x])
	l.sort()
	j = n // 2 - 1
	a = n // 2
	while j >= 0:
		print(l[a], end=' ')
		a += 1
		print(l[j], end=' ')
		j -= 1
	else:
		if a < n:
			print(l[a], end=' ')
	print()


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	mas = list(map(int, input().split()))
	mas.sort()
	new_mas = []
	for i in range((n + 1) // 2):
		if i == n - 1 - i:
			new_mas.append(mas[i])
		else:
			new_mas += [mas[n - 1 - i], mas[i]]
	new_mas = new_mas[::-1]
	ans.append(new_mas)
for i in ans:
	print(*i)


def solve():
	n = int(input())
	a = sorted([int(x) for x in input().split()])
	(l, r) = (0, len(a) - 1)
	cur = 0
	res = []
	while l <= r:
		if cur == 0:
			res.append(str(a[l]))
			l += 1
		else:
			res.append(str(a[r]))
			r -= 1
		cur = 1 - cur
	print(' '.join(res[::-1]))
t = int(input())
for _ in range(t):
	solve()


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [0] * n
	j = 0
	for i in range(n // 2, n):
		b[j] = a[i]
		if i != n - 1 or n % 2 == 0:
			b[j + 1] = a[n - i - 1 - n % 2]
		j += 2
	print(*b)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	out = [None] * n
	for i in range(0, n):
		if i % 2 == 0:
			out[i] = arr[i // 2]
		else:
			out[i] = arr[n - i // 2 - 1]
	out.reverse()
	print(*out)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	now = len(arr) // 2
	minus = True
	for i in range(1, len(arr) + 1):
		print(arr[now], end=' ')
		if minus:
			now -= i
		else:
			now += i
		minus = not minus
	print()


T = int(input())
for cs in range(T):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	pos = n // 2
	for i in range(n):
		pos += i if i % 2 == 0 else -i
		print(a[pos], end=' ')
	print()


import sys
from collections import defaultdict
from copy import copy
R = lambda t=int: t(input())
RL = lambda t=int: [t(x) for x in input().split()]
RLL = lambda n, t=int: [RL(t) for _ in range(n)]

def solve():
	n = R()
	A = sorted(RL())
	for i in range(n):
		if i % 2 == 0:
			j = (n - 1) // 2 - i // 2
		else:
			j = (n + 1) // 2 + i // 2
		print(A[j], end=' ')
	print()
T = R()
for _ in range(T):
	solve()


def main():
	import sys
	input = sys.stdin.buffer.readline

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

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

	def merge(a, start, mid, end, d):
		p = start
		q = mid + 1
		arr = [0] * (end - start + 1)
		k = 0
		coun = 0
		for i in range(start, end + 1):
			if p > mid:
				arr[k] = a[q]
				q += 1
				k += 1
			elif q > end:
				arr[k] = a[p]
				d[a[p]] += coun
				k += 1
				p += 1
			elif a[p] < a[q]:
				arr[k] = a[p]
				d[a[p]] += coun
				k += 1
				p += 1
			else:
				arr[k] = a[q]
				k += 1
				q += 1
				coun += 1
		for i in range(k):
			a[start] = arr[i]
			start += 1

	def mergesort(a, start, end, d):
		if start < end:
			mid = (start + end) // 2
			mergesort(a, start, mid, d)
			mergesort(a, mid + 1, end, d)
			merge(a, start, mid, end, d)

	def inversion(l):
		d = {}
		for i in l:
			d[i] = 0
		mergesort(l, 0, len(l) - 1, d)
		return d

	def binary_search_lower(A, low, high, k):
		if high - low != 1:
			mid = (low + high) // 2
			x = A[mid]
			if x >= k:
				return binary_search_lower(A, low, mid, k)
			else:
				return binary_search_lower(A, mid, high, k)
		if A[low] >= k:
			return low
		else:
			return high

	def binary_expo(x, n):
		if n == 0:
			return 1
		elif n % 2 == 0:
			return binary_expo(x * x, n // 2)
		else:
			return x * binary_expo(x * x, (n - 1) // 2)

	def modu_expo(x, n, m):
		if n == 0:
			return 1
		elif n % 2 == 0:
			return modu_expo(x * x % m, n // 2, m)
		else:
			return x * modu_expo(x * x % m, (n - 1) // 2, m) % m

	def eEuclid(c, m):
		if m == 0:
			global d
			global x
			global y
			d = c
			x = 1
			y = 0
		else:
			eEuclid(m, c % m)
			temp = x
			x = y
			y = temp - c // m * y

	def mod_Inv(c, m):
		eEuclid(c, m)
		return (x % m + m) % m

	def ncr(n, r, p):
		num = den = 1
		for i in range(r):
			num = num * (n - i) % p
			den = den * (i + 1) % p
		return num * pow(den, p - 2, p) % p
	for _ in range(int(input())):
		n = int(input())
		l = [int(y) for y in input().split()]
		l.sort()
		ans = []
		x = n // 2
		if n % 2 == 0:
			ans.append(l[x])
			for i in range(1, x):
				ans.append(l[x - i])
				ans.append(l[x + i])
			ans.append(l[0])
		else:
			ans.append(l[x])
			for i in range(1, x + 1):
				ans.append(l[x + i])
				ans.append(l[x - i])
		for i in ans:
			print(i, end=' ')
		print()
main()


import sys
lines = sys.stdin.readlines()
T = int(lines[0].strip())
for t in range(T):
	n = int(lines[2 * t + 1].strip())
	nums = list(map(int, lines[2 * t + 2].strip().split(' ')))
	nums.sort()
	res = [0 for _ in range(n)]
	res[0] = nums[0]
	for i in range(n):
		if i % 2 == 0:
			res[i] = nums[i // 2]
		else:
			res[i] = nums[-(i + 1) // 2]
	print(' '.join(map(str, res[::-1])))


from collections import defaultdict
import math
from functools import reduce
from heapq import heapify, heappush, heappop
import sys
from sys import stdin, stdout
from random import seed
from random import randint
for t in range(1, int(input()) + 1):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	for i in range((n + 1) // 2):
		if i != n - i - 1:
			ans.append(arr[n - i - 1])
		ans.append(arr[i])
	print(*ans[::-1])


from sys import stdin, stdout
from collections import Counter

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

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

def ip():
	return int(stdin.readline())

def op(ans):
	return stdout.write(str(ans) + '\n')
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	while n != 0:
		print(a.pop(n // 2), end=' ')
		n -= 1


import math

def task_1343_c():
	b = int(input())
	array = [int(num) for num in input().split()]
	maxPositive = 0
	minNegative = -10000000000
	res = 0
	for i in range(b):
		if array[i] < 0:
			if i != 0 and array[i - 1] >= 0:
				res += maxPositive
				maxPositive = 0
			minNegative = max(minNegative, array[i])
		elif i != 0 and array[i - 1] < 0:
			res += minNegative
			minNegative = -10000000000
		maxPositive = max(maxPositive, array[i])
	if minNegative == -10000000000:
		res += maxPositive
	else:
		res += maxPositive + minNegative
	print(res)

def task_1341_b():
	(doorSize, heightLen) = map(int, input().split())
	heights = [int(num) for num in input().split()]
	perf = [0 for i in range(heightLen)]
	a = 0
	for i in range(heightLen - 1):
		if i == 0:
			perf[i] = 0
		else:
			if heights[i - 1] < heights[i] and heights[i] > heights[i + 1]:
				a += 1
			perf[i] = a
	maxl = [0 for i in range(2)]
	local = [0 for i in range(2)]
	for i in range(heightLen - doorSize):
		local[0] = perf[i + doorSize]
		local[1] = i
		if maxl[0] < local[0]:
			maxl[0] = local[0]
			maxl[1] = local[1]
	print(maxl[0], maxl[1])

def task_1340_a():
	print()

def task_1339_b():
	n = int(input())
	array = [int(num) for num in input().split()]
	array.sort()
	output = [0 for i in range(0, n)]
	i = 0
	h = 0
	j = n - 1
	while i <= j:
		output[h] = array[i]
		h += 1
		i += 1
		if h < n:
			output[h] = array[j]
			h += 1
			j -= 1
	for val in reversed(output):
		print(val, end=' ')

def task_1338_a():
	n = int(input())
	inputArr = [int(num) for num in input().split()]
	max_sec = 0
	for i in range(1, n):
		local_sec = 0
		a = inputArr[i - 1] - inputArr[i]
		if a <= 0:
			continue
		else:
			b = math.floor(math.log2(a))
			local_sec = b + 1
			for j in range(b, -1, -1):
				if a < pow(2, j):
					continue
				inputArr[i] += pow(2, j)
				a -= pow(2, j)
			if local_sec > max_sec:
				max_sec = local_sec
	print(max_sec)
a = int(input())
for i in range(a):
	task_1339_b()


import sys
import os
from io import BytesIO, IOBase

def divs(n, start=1):
	divisors = []
	for i in range(start, int(n ** 0.5) + 1):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return len(divisors)

def cel(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return defaultdict(int)

def ddl():
	return defaultdict(list)

def ddd():
	return defaultdict(defaultdict(int))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import defaultdict
for _ in range(ii()):
	n = ii()
	a = li()
	a.sort()
	(l, r) = (0, n - 1)
	res = [0 for i in range(n)]
	j = n - 1
	while l <= r:
		res[j] = a[r]
		if j > 0:
			res[j - 1] = a[l]
		j -= 2
		l += 1
		r -= 1
	print(*res)


import sys
import math
from math import *
from collections import defaultdict
import os
from io import BytesIO, IOBase
from collections import deque
import bisect

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	cnt = 0
	arr.sort()
	i = n // 2
	temp = arr[:n // 2].copy()
	res = []
	if n % 2 == 1:
		print(arr[i], end=' ')
		i += 1
	for j in range(i, n):
		print(arr[j], temp[-1], end=' ')
		temp.pop()
	print()
for i in range(int(input())):
	main()


repeat = int(input())
for i in range(repeat):
	trash = input()
	a = [int(i) for i in input().split()]
	a.sort()
	b = []
	if len(a) % 2 == 0:
		for i in range(len(a) // 2):
			print(a[len(a) // 2 - 1 - i], end=' ')
			print(a[len(a) // 2 + i], end=' ')
	else:
		print(a[len(a) // 2], end=' ')
		for i in range(len(a) // 2):
			print(a[len(a) // 2 + 1 + i], end=' ')
			print(a[len(a) // 2 + 1 - i - 2], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	r1 = n // 2 - 1
	r2 = n // 2
	ans = []
	while r2 < n or r1 >= 0:
		ans.append(a[r2])
		if r1 >= 0:
			ans.append(a[r1])
		r1 -= 1
		r2 += 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	index = n // 2
	distance = -1
	while 0 <= index < n:
		print(a[index], end=' ')
		index += distance
		if distance < 0:
			distance -= 1
		else:
			distance += 1
		distance *= -1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	a.sort()
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	if n % 2:
		ans.append(a[n // 2])
	print(*reversed(ans))


t = int(input())
for p in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	i = 0
	j = len(lst) - 1
	lst.sort()
	ans = []
	while i <= j:
		if i == j:
			ans.append(lst[i])
		else:
			ans.append(lst[i])
			ans.append(lst[j])
		i += 1
		j -= 1
	ans.reverse()
	for value in ans:
		print(value, end=' ')
	print('')


import math
t = int(input())
for l in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	li.sort()
	brr = []
	p = int(n / 2)
	if p == n / 2:
		p -= 1
	r = 1
	for i in range(p, -1, -1):
		v = i + r
		brr.append(li[i])
		if v >= n:
			break
		brr.append(li[v])
		r += 2
	for ele in brr:
		print(ele, end=' ')
	print()


for i in range(int(input())):
	N = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	n = len(a)
	while n:
		print(a.pop(n // 2), end=' ')
		n -= 1


for _ in range(int(input())):
	n = int(input())
	m = -1 if n % 2 else 1
	s = sorted(map(int, input().split()))
	i = 1
	ind = (len(s) - 1) // 2
	while 0 <= ind < len(s):
		print(s[ind], end=' ')
		ind += m * i
		m *= -1
		i += 1
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	(low, high) = (0, n - 1)
	const = []
	while low < high:
		const.append(a[high])
		const.append(a[low])
		high -= 1
		low += 1
	if low == high:
		const.append(a[low])
	const = const[::-1]
	print(*const)


def func(arr):
	list.sort(arr)
	left = 0
	right = len(arr)
	newArr = []
	while left < right:
		newArr.append(arr[right - 1])
		right -= 1
		if left < right:
			newArr.append(arr[left])
			left += 1
	for j in range(len(newArr) - 1, -1, -1):
		print(newArr[j], end=' ')
	print()
cases = int(input())
for i in range(cases):
	size = int(input())
	arr = [int(n) for n in input().split()]
	func(arr)


import math
t = int(input())
for g in range(0, t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	if n % 2 == 0:
		k = int(n / 2) - 1
	else:
		k = int(n / 2)
	b = []
	b.append(a[k])
	i = k - 1
	j = k + 1
	while i >= 0 and j <= n - 1:
		b.append(a[j])
		j = j + 1
		b.append(a[i])
		i = i - 1
	if n % 2 == 0:
		b.append(a[n - 1])
	for i in range(0, n):
		print(b[i], end=' ')
	print('')


for _ in range(int(input())):
	n = int(input())
	x = sorted(list(map(int, input().split())))
	left = 0
	right = len(x) - 1
	k = []
	if n % 2 == 0:
		while left <= right:
			k.append(x[right])
			k.append(x[left])
			left += 1
			right -= 1
	else:
		while left < right:
			k.append(x[right])
			k.append(x[left])
			left += 1
			right -= 1
		k.append(x[n // 2])
	print(*k[::-1])


def main():
	for _ in range(int(input())):
		n = int(input())
		arr = list(map(int, input().strip().split()))
		arr.sort()
		if n % 2 == 1:
			print(arr[n // 2], end=' ')
			i = n // 2 - 1
			j = n // 2 + 1
			while i >= 0:
				print(arr[j], arr[i], end=' ')
				i -= 1
				j += 1
		else:
			i = n // 2 - 1
			j = n // 2
			while i >= 0:
				print(arr[j], arr[i], end=' ')
				i -= 1
				j += 1
		print()
main()


t = int(input())

def count():
	(n, a, f) = (int(input()), list(map(int, input().split(' '))), [])
	a.sort()
	if n % 2 == 0:
		for i in range(int(n / 2)):
			f.append(a[i])
			f.append(a[-1 - i])
	else:
		f.append(a[0])
		a.remove(a[0])
		for i in range(int((n - 1) / 2)):
			f.append(a[-1 - i])
			f.append(a[i])
	f.reverse()
	return f
for i in range(t):
	print(*count())


from sys import stdin, stdout
T = int(stdin.readline())
for _ in range(T):
	N = int(stdin.readline())
	arr = [int(i) for i in stdin.readline().strip().split()]
	arr.sort()
	answer = []
	idx1 = 0
	idx2 = len(arr) - 1
	while idx1 < idx2:
		answer.append(arr[idx1])
		answer.append(arr[idx2])
		idx1 += 1
		idx2 -= 1
	if idx1 == idx2:
		answer.append(arr[idx1])
	stdout.write(' '.join((str(i) for i in answer[::-1])))
	stdout.write('\n')


input = __import__('sys').stdin.readline
print = __import__('sys').stdout.write
for _ in range(int(input())):
	n = int(input())
	l = sorted(map(int, input().split()))
	idx = (n - 1) // 2
	r = 1
	for k in range(n):
		print(f'{l[idx]} ')
		idx += r
		if r > 0:
			r += 1
		else:
			r -= 1
		r = -r
	print('\n')


t = int(input())
for i in range(t):
	n = int(input())
	ai = list(map(int, input().split()))
	ai.sort()
	bi = [0] * n
	for i in range(n // 2):
		bi[n - i * 2 - 1] = ai[n - 1 - i]
		bi[n - i * 2 - 2] = ai[i]
	if n % 2 == 1:
		bi[0] = ai[n // 2]
	print(' '.join(map(str, bi)))


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	array = [l[n // 2]]
	offset = 1
	for i in range((n - 1) // 2):
		array.append(l[n // 2 - offset])
		array.append(l[n // 2 + offset])
		offset += 1
	if n % 2 == 0:
		array.append(l[0])
	for i in array:
		print(i, end=' ')
	print()


from sys import stdin, stdout
Pi = lambda x: stdout.write(str(x) + '\n')
Ps = lambda x: stdout.write(str(x))
S = lambda x: x * (x + 1) // 2
I = lambda x: 1 + 2 * x
R = lambda : stdin.readline()
Ri = lambda x: map(int, x.split())
Rs = lambda x: map(str, x.split())
Rf = lambda x: map(float, x.split())
MaxN = int(100000.0) + 10

def main():
	for x in stdin:
		t = int(x)
		for test in range(t):
			n = int(R())
			A = list(Ri(R()))
			B = []
			i = n // 2 - 1
			if n % 2:
				i += 1
			j = i + 1
			sw = 1
			A.sort()
			while i >= 0 or j < n:
				if sw and i >= 0:
					B.append(str(A[i]))
					i -= 1
				elif j < n:
					B.append(str(A[j]))
					j += 1
				sw = (sw + 1) % 2
			if i >= 0:
				B.append(str(A[0]))
			if j < n:
				B.append(str(A[j]))
			print(' '.join(B))
main()


for i in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	s = n // 2
	ans = []
	for i in range(n):
		ans.append(A[s])
		if i % 2 == 0:
			s = s - (i + 1)
		else:
			s = s + (i + 1)
	print(*ans)


import sys, math, cmath, time
start_time = time.time()

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

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

def insr():
	s = input()
	return s[:len(s) - 1]

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

def solve():
	n = inp()
	a = inlt()
	q = []
	a.sort()
	for i in range(math.ceil(len(a) / 2)):
		q.append(a[n - i - 1])
		q.append(a[i])
	if len(a) % 2 == 1:
		q.pop()
	q.reverse()
	print(*q)
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
t = 1
t = inp()
for tt in range(t):
	solve()
if not ONLINE_JUDGE:
	print('Time Elapsed:', time.time() - start_time, 'seconds')
sys.stdout.close()


t = int(input())
for test in range(t):
	n = int(input())
	arr = sorted(list(map(int, input().split())))
	ans = []
	for i in range(n // 2):
		ans.append(arr[-1 - i])
		ans.append(arr[i])
	if n % 2 != 0:
		ans.append(arr[n // 2])
	print(*ans[::-1])


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')[:n + 1]))
	a.sort()
	i = 0
	j = n - 1
	result = []
	while i <= j:
		if i == j:
			result.append(a[i])
			break
		result.append(a[i])
		result.append(a[j])
		i += 1
		j -= 1
	print(*[i for i in result[::-1]])


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	b = [0] * n
	j = 0
	while j < n:
		if j % 2 == 0:
			b[j] = a[j // 2]
		else:
			b[j] = a[n - 1 - j // 2]
		j += 1
	print(*b[::-1])


for t in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	k = (n - 1) // 2
	(i, j) = (k, k + 1)
	turn = (n + 1) % 2
	ans = []
	while i != -1 or j != n:
		if turn == 0:
			ans.append(a[i])
			i -= 1
		else:
			ans.append(a[j])
			j += 1
		turn = (turn + 1) % 2
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	if n % 2 == 1:
		i = n // 2
	else:
		i = n // 2 - 1
	cnt = 1
	print(arr[i], end=' ')
	while True:
		i = i + cnt
		if i >= n:
			break
		print(arr[i], end=' ')
		cnt += 1
		i = i - cnt
		if i < 0:
			break
		print(arr[i], end=' ')
		cnt += 1
	print('')


import sys

def set_debug(debug_mode=False):
	if debug_mode:
		fin = open('input.txt', 'r')
		sys.stdin = fin
set_debug(False)
for _ in range(int(input())):
	n = int(input())
	res = []
	cur = list(map(int, input().split()))
	cur.sort()
	l = len(cur)
	if l % 2 == 0:
		pos = l // 2 - 1
		ne = l // 2
	else:
		res.append(cur[l // 2])
		pos = l // 2 - 1
		ne = l // 2 + 1
	while pos >= 0:
		res.append(cur[pos])
		res.append(cur[ne])
		pos -= 1
		ne += 1
	print(' '.join([str(x) for x in res]))


for i in range(int(input())):
	N = int(input())
	lis = list(map(int, input().split()))
	lis.sort()
	mid = len(lis) // 2
	output = [lis[mid]]
	length = len(lis) // 2
	l = len(lis)
	for i in range(1, length + 1):
		output.append(lis[mid - i])
		if mid + i < l:
			output.append(lis[mid + i])
	for i in output:
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l1 = []
	j = 0
	while len(l1) < n:
		l1.append(l[j])
		l1.append(l[n - 1 - j])
		j += 1
	if len(l1) > n:
		del l1[len(l1) - 1]
	l1.reverse()
	print(*l1)


from collections import deque
for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	res = deque()
	for i in range(n // 2):
		res.appendleft(a[n - 1 - i])
		res.appendleft(a[i])
	if n & 1:
		res.appendleft(a[n // 2])
	print(*res)


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

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

def lmii():
	return list(mii())

def main():
	for _ in range(ii()):
		n = ii()
		x = lmii()
		x.sort()
		half = n // 2
		if n % 2 != 0:
			print(x[half], end=' ')
			for i in range(1, half + 1):
				print(x[n // 2 + i], end=' ')
				print(x[n // 2 - i], end=' ')
			print(sep='')
			continue
		for i in range(half):
			print(x[n // 2 + i], end=' ')
			print(x[n // 2 - i - 1], end=' ')
		print(sep='')
main()


T = int(input())
k = [0] * T
ls = [0] * T
for t in range(T):
	k[t] = int(input())
	ls[t] = [int(i) for i in input().split(' ')]

def rank(l):
	l.sort()
	l1 = []
	for i in range(len(l)):
		if i % 2 == 0:
			l1.append(str(l[int(i / 2)]))
		else:
			l1.append(str(l[len(l) - int((i + 1) / 2)]))
	l1.reverse()
	return l1
for t in range(T):
	print(' '.join(rank(ls[t])))


T = int(input())
for t in range(T):
	X = int(input())
	N = list(map(int, input().split()))
	N.sort()
	newArr = []
	for n in range(int(len(N) / 2)):
		newArr.append(N[n])
		newArr.append(N[len(N) - 1 - n])
	if len(N) % 2 == 1:
		newArr.append(N[int(len(N) / 2)])
	print(' '.join(list(map(str, newArr[::-1]))))


for i in range(int(input())):
	n = int(input())
	arr = [int(i) for i in input().split(' ')]
	arr.sort()
	ans = [0 for i in range(n)]
	if n % 2 == 0:
		k = n - 1
		for i in range(n // 2):
			ans[k] = str(arr[n - i - 1])
			k -= 1
			ans[k] = str(arr[i])
			k -= 1
	else:
		k = n - 1
		ans[0] = str(arr[n // 2])
		for i in range(n // 2):
			ans[k] = str(arr[n - i - 1])
			k -= 1
			ans[k] = str(arr[i])
			k -= 1
	print(' '.join(ans))


from collections import deque
for t in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	dq = []
	for i in range(n // 2):
		dq.append(arr[i])
		dq.append(arr[n - i - 1])
	if n & 1:
		dq.append(arr[n // 2])
	dq = dq[::-1]
	print(' '.join([str(i) for i in dq]))


import sys
from collections import deque
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = deque()
	cnt = 0
	for i in range(n):
		ans.appendleft(a[i])
		cnt += 1
		if cnt >= n:
			break
		ans.appendleft(a[-i - 1])
		cnt += 1
		if cnt >= n:
			break
	print(*ans)


def convertArrayToInt(A):
	for i in range(0, len(A), 1):
		A[i] = int(A[i])
	return A

def sortDiffAscendingOrder(A, n):
	A.sort()
	low = 0
	high = n - 1
	ans = []
	while low <= high:
		if low == high:
			ans.append(A[low])
		else:
			ans.append(A[high])
			ans.append(A[low])
		low += 1
		high -= 1
	return ans[::-1]
testCases = int(input())
while testCases:
	n = int(input())
	X = input().split()
	X = convertArrayToInt(X)
	ans = sortDiffAscendingOrder(X, n)
	for x in ans:
		print(x, end=' ')
	print()
	testCases -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	c = n // 2
	x = 0
	res = []
	while x < n:
		res.append(a[c])
		if x % 2 == 0:
			c = c - (x + 1)
		else:
			c = c + (x + 1)
		x += 1
	print(*res)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		a.sort()
		r = n // 2
		l = r - 1
		final = []
		for j in range(n // 2):
			final.append(a[r])
			final.append(a[l])
			r = r + 1
			l = l - 1
		print(*final)
	else:
		a.sort()
		final = []
		d = a[n // 2]
		final.append(d)
		r = n // 2 + 1
		l = n // 2 - 1
		for j in range(n // 2):
			final.append(a[r])
			final.append(a[l])
			r = r + 1
			l = l - 1
		print(*final)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = [0 for i in range(n)]
	if len(arr) % 2 == 0:
		k = n - 1
		for i in range(0, n // 2):
			ans[k] = arr[n - i - 1]
			k -= 1
			ans[k] = arr[i]
			k -= 1
	else:
		ans[0] = arr[n // 2]
		k = n - 1
		for i in range(0, n // 2):
			ans[k] = arr[n - i - 1]
			k -= 1
			ans[k] = arr[i]
			k -= 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(j) for j in input().split()]
	brr = []
	arr.sort()
	for i in range(n // 2):
		brr += [arr[-1 - i], arr[i]]
	if n % 2 == 1:
		brr += [arr[n // 2]]
	print(*brr[::-1])


from sys import stdin

def iinput():
	return int(stdin.readline())

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

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	n = iinput()
	a = linput()
	a.sort()
	ans = []
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	if n & 1:
		ans.append(a[n // 2])
	ans.reverse()
	print(*ans)


from collections import deque
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	a = deque(a)
	ans = []
	while a:
		f = a.popleft()
		ans.append(f)
		if a:
			b = a.pop()
			ans.append(b)
	print(*reversed(ans))


testCases = int(input())
for _ in range(testCases):
	length = int(input())
	x = list(map(int, input().split()))
	x.sort()
	a = x[0:length // 2]
	b = x[length // 2:length]
	a.reverse()
	for i1 in range(length // 2):
		print(b[i1], end=' ')
		print(a[i1], end=' ')
	if length % 2 == 1:
		print(b[length // 2], end=' ')
	print('')


t = int(input())
for test in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if len(a) == 1:
		print(a[0])
	else:
		if n % 2 == 1:
			b = [a[n // 2]]
			if a[n // 2 + 1] - a[n // 2] < a[n // 2] - a[n // 2 - 1]:
				j = 1
			else:
				j = -1
			for k in range(1, n // 2 + 1):
				if j > 0:
					b.append(a[n // 2 + k])
					b.append(a[n // 2 - k])
				else:
					b.append(a[n // 2 - k])
					b.append(a[n // 2 + k])
		else:
			b = [a[n // 2]]
			for k in range(1, n // 2):
				b.append(a[n // 2 - k])
				b.append(a[n // 2 + k])
			b.append(a[0])
		for x in b:
			print(x, end=' ')
		print()


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	for i in range(n // 2, n):
		if n - i - 1 == i:
			print(a[i], end=' ')
		else:
			print(a[n - i - 1], a[i], end=' ')
	print()


import sys
import math as mt
input = sys.stdin.buffer.readline
import bisect
t = int(input())
for __ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	i = n // 2 - 1
	j = n // 2 + 1
	ans.append(a[n // 2])
	n1 = n
	n -= 1
	ch = 0
	if n1 - n // 2 - 1 > n // 2:
		ch = 1
	while n:
		if j >= n1:
			ans.append(a[i])
			i -= 1
		else:
			if ch % 2 == 0:
				ans.append(a[j])
				j += 1
			else:
				ans.append(a[i])
				i -= 1
			ch += 1
		n -= 1
	print(*ans)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		nos = list(map(int, input().split()))
		nos.sort()
		i = 0
		j = n - 1
		answer = []
		while i < j:
			answer.append(nos[j])
			j -= 1
			answer.append(nos[i])
			i += 1
		if i == j:
			answer.append(nos[i])
		answer.reverse()
		for i in answer:
			print(i, end=' ')
		print()
main()


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

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

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

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

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	a = sorted(li())
	l = []
	i = 0
	j = n - 1
	while i <= j:
		l.append(a[i])
		if i != j:
			l.append(a[j])
		i += 1
		j -= 1
	print(*l[::-1])


import math

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	b_i = n - 1
	s_i = 0
	for i in range(n):
		if i % 2 == 0:
			ans.append(a[b_i])
			b_i -= 1
		else:
			ans.append(a[s_i])
			s_i += 1
	ans.reverse()
	return ' '.join(map(str, ans))
t = int(input())
while t > 0:
	t -= 1
	print(solve())


t = int(input())

def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	res = []
	l = 0
	r = n - 1
	temp = 0
	while l <= r:
		if temp == 0:
			res.append(a[r])
			r -= 1
		else:
			res.append(a[l])
			l += 1
		temp ^= 1
	res = res[::-1]
	for x in res:
		print(x, end=' ')
	print()
for _ in range(t):
	solve()


I = lambda : list(map(int, input().split()))
z = 'abcdefghijklmnopqrstuvwxyz'
for _ in range(int(input())):
	(n,) = I()
	l = sorted(I())
	an = []
	if n % 2:
		an.append(l[n // 2])
	for i in range((n + 1) // 2, n):
		an.append(l[i])
		an.append(l[n - i - 1])
	print(*an)


def solve():
	n = int(input())
	li = [int(x) for x in input().split()]
	li.sort()
	sort_adjacent = [0] * n
	k = n - 1
	if n % 2 != 0:
		sort_adjacent[0] = li[n // 2]
	for i in range(n // 2):
		sort_adjacent[k] = li[i]
		k -= 1
		sort_adjacent[k] = li[n - i - 1]
		k -= 1
	print(*sort_adjacent)
	return
t = int(input())
for i in range(t):
	solve()


import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)
t = int(input())
for i in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	s = n // 2
	left = True
	cnt = 1
	while True:
		if n % 2 == 0 and s == 0:
			print(a[s])
			break
		if n % 2 == 1 and s == n - 1:
			print(a[s])
			break
		print(a[s], end=' ')
		if left:
			s -= cnt
			left = False
			cnt += 1
		else:
			s += cnt
			left = True
			cnt += 1


from math import ceil, sqrt, floor, sqrt
import collections
from typing import List
from fractions import gcd
from collections import deque
from collections import Counter, deque
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	res = [0] * n
	if n % 2 == 1:
		res[0] = A[n // 2]
		for i in range(n // 2):
			res[2 * i + 1] = A[n // 2 + i + 1]
			res[2 * i + 2] = A[n // 2 - i - 1]
		print(' '.join((str(c) for c in res)))
	else:
		for i in range(n // 2):
			res[2 * i] = A[n // 2 + i]
			res[2 * i + 1] = A[n // 2 - i - 1]
		print(' '.join((str(c) for c in res)))


n = int(input())
for ti in range(0, n):
	k = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	r = 0
	s = (k + 1) // 2 - 1
	t = []
	while True:
		if len(t) % 2 == 0:
			t.append(arr[s - r])
			s -= r
			r += 1
		else:
			t.append(arr[s + r])
			s += r
			r += 1
		if len(t) == k:
			break
	for i in t:
		print(i, end=' ')
	print()


def main():
	for _ in inputt():
		(n,) = inputi()
		A = inputl()
		A.sort()
		(A[::2], A[1::2]) = (A[:(n + 1) // 2], A[::-1][:n // 2])
		print(*A[::-1])
from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(3000)
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.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(io.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):
	sys.stdout.write(kwargs.pop('split', ' ').join(map(str, args)))
	sys.stdout.write(kwargs.pop('end', '\n'))
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip()
inputt = lambda t=0: range(t) if t else range(int(input()))
inputs = lambda : input().split()
inputi = lambda : map(int, inputs())
inputl = lambda : list(inputi())

def len(a):
	if isinstance(a, range):
		return -((a.start - a.stop) // a.step)
	return builtins.len(a)

def bisect_left(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if key(a[mid]) < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def bisect_right(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if x < key(a[mid]):
			hi = mid
		else:
			lo = mid + 1
	return lo

def insort_left(a, x, key=None, lo=0, hi=None):
	lo = bisect_left(a, x, key, lo, hi)
	a.insert(lo, x)

def insort_right(a, x, key=None, lo=0, hi=None):
	lo = bisect_right(a, x, key, lo, hi)
	a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right

def index(a, x, key=None, default=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi and key(a[i]) == x:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_lt(a, x, key=None, default=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_le(a, x, key=None, default=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_gt(a, x, key=None, default=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_ge(a, x, key=None, default=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError
main()


for _ in range(int(input())):
	(i, j, r) = (0, int(input()) - 1, [])
	l = sorted(map(int, input().split()))
	while i < j:
		r.append(l[i])
		r.append(l[j])
		i += 1
		j -= 1
	if i == j:
		r.append(l[i])
	print(' '.join(map(str, r[::-1])))


t = int(input())
fl = []
for i in range(t):
	n = int(input())
	s = input()
	l = s.split(' ')
	for i in range(n):
		l[i] = int(l[i])
	fl.append(l)
fll = []
for ii in fl:
	i = ii[:]
	i.sort()
	ll = []
	f = 0
	while len(i) != 0:
		if f == 1:
			ll.append(i[len(i) - 1])
			i.pop(len(i) - 1)
			f = 0
		else:
			ll.append(i[0])
			i.pop(0)
			f = 1
	ll.reverse()
	fll.append(ll)
for i in range(len(fll)):
	for j in range(len(fll[i])):
		fll[i][j] = str(fll[i][j])
ssl = []
for i in fll:
	ss = ' '.join(i)
	ssl.append(ss)
for i in ssl:
	print(i)


t = int(input())
for w in range(t):
	n = int(input())
	values = [int(i) for i in input().split()]
	values.sort(reverse=True)
	new = []
	while len(values) > 1:
		new.append(values[-1])
		new.append(values[0])
		del values[0]
		del values[-1]
	if len(values) > 0:
		new.append(values[0])
	new = new[::-1]
	for i in new:
		print(i, end=' ')
	print()


t = int(input())
td = t
temp_output_case = []
while t > 0:
	input_case = []
	a = int(input())
	str_in = input()
	input_case = list(map(int, str_in.strip().split()))
	temp_case = sorted(input_case)
	new_case = []
	a1_number = a // 2
	a1 = temp_case[a1_number]
	new_case.append(a1)
	tt = 1
	if a % 2 == 1:
		while a1_number - tt >= 0:
			p = int(a1_number - tt)
			q = temp_case[p]
			new_case.append(q)
			c = int(a1_number + tt)
			d = temp_case[c]
			new_case.append(d)
			tt += 1
	else:
		while a1_number - tt > 0:
			p = int(a1_number - tt)
			q = temp_case[p]
			new_case.append(q)
			c = int(a1_number + tt)
			d = temp_case[c]
			new_case.append(d)
			tt += 1
		e = temp_case[0]
		new_case.append(e)
	for case in new_case:
		print(case, end=' ')
	print('\t')
	t -= 1


import math
for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	k = []
	if len(l) % 2 == 0:
		i = int(len(l) / 2)
		k.append(l[i])
		count = 1
		while i - count >= 0 and i + count + 1 <= len(l):
			k.append(l[i - count])
			k.append(l[i + count])
			count += 1
		while i - count >= 0:
			k.append(l[i - count])
			count += 1
		while i + count + 1 <= len(l):
			k.append(l[i + count])
			count += 1
	else:
		i = math.ceil(int(len(l) / 2))
		k.append(l[i])
		count = 1
		while i - count >= 0 and i + count + 1 <= len(l):
			k.append(l[i - count])
			k.append(l[i + count])
			count += 1
	for i in k:
		print(i, end=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	b = []
	h = n - 1
	l = 0
	while l <= h:
		b.append(a[h])
		h -= 1
		if l > h:
			break
		b.append(a[l])
		l += 1
	b = b[::-1]
	for i in b:
		print(i, end=' ')
	print()


import math
q = int(input())
for _ in range(q):
	n = int(input())
	A = list(map(int, input().split(' ')))
	A.sort()
	(a, b) = ([], [])
	ln = math.ceil(n / 2)
	for i in range(ln):
		a.append(A[i])
	for i in range(ln, n):
		b.append(A[i])
	(p1, p2) = (0, len(a) - 1)
	ans = []
	while p1 < len(b) or p2 >= 0:
		ans.append(a[p2])
		p2 -= 1
		if p1 < len(b):
			ans.append(b[p1])
			p1 += 1
	for i in ans:
		print(i, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	mas = [int(item) for item in input().split()]
	mas.sort()
	while mas != []:
		print(mas.pop(len(mas) // 2), end=' ')


cases = int(input())
for i in range(cases):
	n = int(input())
	a = [int(b) for b in input().split()]
	a.sort()
	half = n // 2
	ans = []
	for i in range(1, n + 1):
		ans.append(a[half])
		if i % 2 == 1:
			half -= i
		else:
			half += i
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n != 1:
		A = list(map(int, input().split()))
		A.sort()
		B = A[:n // 2]
		C = A[n // 2:]
		B.sort(reverse=True)
		C.sort()
		for i in range(n):
			if i != n - 1:
				if i % 2 == 0:
					print(C[i // 2], end=' ')
				else:
					print(B[i // 2], end=' ')
			elif i % 2 == 0:
				print(C[i // 2])
			else:
				print(B[i // 2])


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	mid = n // 2
	if n & 1 == 0:
		mid -= 1
	i = 1
	print(arr[mid], end=' ')
	while mid - i >= 0 and mid + i <= n - 1:
		print(arr[mid + i], end=' ')
		print(arr[mid - i], end=' ')
		i += 1
	if n & 1 == 0:
		print(arr[n - 1], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	ans = []
	dist = 1
	for i in range(n):
		if i == 0:
			mid = n // 2
			ans.append(a[mid])
		elif i % 2 > 0:
			mid -= dist
			ans.append(a[mid])
			dist += 1
		else:
			mid += dist
			ans.append(a[mid])
			dist += 1
	print(*ans)


from math import ceil, gcd, floor
from collections import deque, defaultdict as dict
from heapq import heappush as hpush, heappop as hpop, heapify
from functools import lru_cache
import sys

def inpi():
	return int(input())

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

def inp():
	s = input()
	return list(s)

def inpv():
	return map(int, input().split())
testcase = int(input())
for test in range(testcase):
	n = inpi()
	a = inpa()
	a.sort()
	a1 = a[:(n + 1) // 2]
	a2 = a[(n + 1) // 2:][::-1]
	while a1 or a2:
		if a1:
			print(a1.pop(), end=' ')
		if a2:
			print(a2.pop(), end=' ')
	print()


def solveAll():
	nbCases = int(input())
	for _ in range(nbCases):
		case = readCase()
		print(*solve(case))

def readCase():
	nbNums = int(input())
	return [int(x) for x in input().split()]

def solve(nums):
	nums.sort()
	result = nums.copy()
	left = 0
	right = len(nums) - 1
	position = len(nums) - 1
	while left < right:
		result[position] = nums[right]
		result[position - 1] = nums[left]
		position -= 2
		left += 1
		right -= 1
	if left == right:
		result[0] = nums[left]
	return result
solveAll()


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	k = n // 2
	b = []
	for i in range(2 * (n // 2)):
		if i % 2 == 0:
			b.append(a[i // 2])
		else:
			b.append(a[n - i // 2 - 1])
	if n % 2 == 1:
		b.append(a[n // 2])
	b = b[::-1]
	print(*b)


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

def in_int():
	return int(input())

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

def in_str():
	s = input()
	return list(s[:len(s) - 1])

def in_ints():
	return map(int, input().split())
t = in_int()
from operator import itemgetter
for tt in range(t):
	n = in_int()
	a = in_list()
	a = sorted(a)
	ans = []
	i = 0
	j = n - 1
	while i < j:
		ans.append(a[i])
		ans.append(a[j])
		i += 1
		j -= 1
	if i == j:
		ans.append(a[i])
	for xx in ans[::-1]:
		print(xx, end=' ')
	print()


from math import floor
T = int(input())
for case in range(T):
	out = ''
	N = int(input())
	data = input()
	data = data.split()
	for i in range(N):
		data[i] = int(data[i])
	data.sort()
	center = floor(N / 2)
	ans = [data[center]]
	for x in range(1, center + 1):
		try:
			ans += [data[center - x]]
			ans += [data[center + x]]
		except Exception:
			pass
	for elt in ans:
		out += str(elt)
		out += ' '
	print(out)


def f(a):
	a = sorted(a)
	size = len(a)
	if size % 2 == 0:
		right_ind = size // 2
		left_ind = right_ind - 1
		b = [a[left_ind], a[right_ind]]
		for i in range(left_ind):
			b.append(a[left_ind - i - 1])
			b.append(a[right_ind + i + 1])
	else:
		ind = size // 2
		b = [a[ind]]
		for i in range(ind):
			b.append(a[ind + i + 1])
			b.append(a[ind - i - 1])
	return ' '.join(map(str, b))
m = int(input())
res = []
for _ in range(m):
	n = int(input())
	a = list(map(int, input().split()))
	res.append(f(a))
for s in res:
	print(s)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	(i, j) = (0, n - 1)
	while i < j:
		ans.append(str(a[i]))
		ans.append(str(a[j]))
		i += 1
		j -= 1
	if i == j:
		ans.append(str(a[i]))
	ans.reverse()
	print(' '.join(ans))


import sys
from collections import defaultdict, deque
from math import sqrt

def input():
	return sys.stdin.readline()[:-1]

def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	c = deque(a.copy())
	i = 0
	a = []
	while c:
		i ^= 1
		if i:
			a.append(c.pop())
		else:
			a.append(c.popleft())
	a.reverse()
	print(*a)
t = int(input())
for _ in range(t):
	solve()


for t in range(int(input().strip())):
	n = int(input().strip())
	arr = list(map(int, input().strip().split()))
	arr.sort()
	res = []
	(l, r) = (0, n - 1)
	while l < r:
		res.append(str(arr[r]))
		res.append(str(arr[l]))
		l += 1
		r -= 1
	if l == r:
		res.append(str(arr[l]))
	print(' '.join(res[::-1]))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	for i in range(n // 2, n):
		if i == n - i - 1:
			print(a[i], end=' ')
		else:
			print(a[n - i - 1], a[i], end=' ')
	print()


T = int(input())
for t in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	temp = n // 2
	if n % 2 == 0:
		temp -= 1
	(left, right) = (temp, temp)
	print(a[temp], end=' ')
	while 1:
		right = right + 1
		left = left - 1
		if right <= n - 1:
			print(a[right], end=' ')
		if left >= 0:
			print(a[left], end=' ')
		if right >= n and left < 0:
			print()
			break


test = int(input())
for _ in range(test):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr = sorted(arr)
	(i, j) = (0, n - 1)
	temp = []
	while i < j:
		temp.append(arr[j])
		temp.append(arr[i])
		i += 1
		j -= 1
	if i == j:
		temp.append(arr[i])
	for i in reversed(range(n)):
		print(temp[i], end=' ')
	print()


import sys

def f(val):
	l = val.split(' ')
	l = sorted([int(x) for x in l])
	new = [0 for _ in range(len(l))]
	new[-1] = l[-1]
	new[-2] = l[0]
	i = 3
	left = 1
	right = -2
	while i <= len(l):
		if abs(l[left] - new[-i + 1]) > abs(l[right] - new[-i + 1]):
			new[-i] = l[left]
			left += 1
		else:
			new[-i] = l[right]
			right -= 1
		i += 1
	print(' '.join([str(x) for x in new]))
for line in sys.stdin:
	n = int(line)
	break
n *= 2
i = 0
for line in sys.stdin:
	if i % 2 == 1:
		f(line[:-1])
	i += 1
	if i >= n:
		break


for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	list1.sort()
	ans = []
	f = n // 2
	b = n // 2 - 1
	if n % 2 == 0:
		for j in range(n // 2):
			ans.append(list1[b])
			b -= 1
			ans.append(list1[f])
			f += 1
	else:
		f = n // 2 + 1
		b = n // 2 - 1
		ans.append(list1[n // 2])
		for j in range(n // 2):
			ans.append(list1[b])
			b -= 1
			ans.append(list1[f])
			f += 1
	for item in ans:
		print(item, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	ans = []
	arr = [int(x) for x in input().split()]
	arr.sort()
	switcher = 0
	while arr:
		ans.append(arr.pop(switcher))
		if switcher:
			switcher = 0
		else:
			switcher = -1
	print(*ans[::-1])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
testcases = int(input())
for j in range(testcases):
	n = int(input())
	vals = list(map(int, input().split()))
	vals.sort()
	outputlist = []
	if n % 2 == 0:
		cv = 0
		while cv < n // 2:
			p1 = vals[cv]
			p2 = vals[-1 - cv]
			outputlist.append(str(p1))
			outputlist.append(str(p2))
			cv += 1
	elif n % 2 == 1:
		cv = 0
		while cv < n // 2:
			p1 = vals[cv]
			p2 = vals[-1 - cv]
			outputlist.append(str(p1))
			outputlist.append(str(p2))
			cv += 1
		outputlist.append(str(vals[n // 2]))
	print(' '.join(outputlist[::-1]))


from collections import deque
import math
for t in range(int(input())):
	n = int(input())
	arr = sorted(list(map(int, input().split())))
	res = []
	if n % 2:
		res.append(arr[n // 2])
	for i in range(n // 2 - 1, -1, -1):
		res.append(arr[i])
		res.append(arr[n - i - 1])
	print(*res)


for _ in range(int(input())):
	(n, l, a) = (int(input()), list(map(int, input().split())), [])
	l.sort()
	for (x, y) in zip(range(n), reversed(range(n))):
		if x < y:
			a.append(l[y])
			a.append(l[x])
		elif x == y:
			a.append(l[x])
		else:
			break
	a.reverse()
	print(*a, sep=' ')


def solve(n, k):
	k.sort()
	mid = n // 2
	state = 0
	if n % 2 == 0:
		pointer1 = mid - 1
		pointer2 = mid
	else:
		pointer1 = mid - 1
		pointer2 = mid + 1
		diff1 = abs(k[pointer1] - k[mid])
		diff2 = abs(k[pointer2] - k[mid])
		if diff2 > diff1:
			print(k[mid], k[pointer1], k[pointer2], end=' ')
		else:
			print(k[mid], k[pointer2], k[pointer1], end=' ')
			state = 1
		pointer1 -= 1
		pointer2 += 1
	while pointer1 >= 0 and pointer2 < n:
		if state == 0:
			print(k[pointer1], k[pointer2], end=' ')
		else:
			print(k[pointer2], k[pointer1], end=' ')
		pointer1 -= 1
		pointer2 += 1
	print('')
n = int(input())
for x in range(n):
	x = int(input())
	seq2 = list(map(int, input().split()))
	solve(x, seq2)


t = int(input())
for you in range(t):
	n = int(input())
	l = input().split()
	li = [int(i) for i in l]
	li.sort()
	l = []
	while li != []:
		l.append(li[-1])
		li.pop(-1)
		if li != []:
			l.append(li[0])
			li.pop(0)
	l.reverse()
	for i in l:
		print(i, end=' ')
	print()


t = int(input())
for x in range(t):
	n = int(input())
	inp = list(map(int, input().split()))
	inp.sort()
	i = 0
	j = len(inp) - 1
	inp2 = []
	while j >= i:
		if j == i:
			inp2 += [inp[i]]
			j -= 1
		else:
			inp2 += [inp[i]]
			inp2 += [inp[j]]
			i += 1
			j -= 1
	inp2.reverse()
	print(*inp2)


for _ in range(int(input())):
	n = int(input())
	x = sorted(map(int, input().split()))
	cur = n // 2
	res = []
	for i in range(n):
		cur += i * (-1 if i & 1 else 1)
		res.append(x[cur])
	print(*res)


for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar = sorted(ar)
	ans = []
	if n & 1:
		for i in range(int(n / 2)):
			ans.append(ar[i])
			ans.append(ar[n - i - 1])
		ans.append(ar[int(n / 2)])
	else:
		for i in range(int(n / 2)):
			ans.append(ar[i])
			ans.append(ar[n - i - 1])
	for i in ans[::-1]:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = [int(i) for i in input().split()]
	arr.sort()
	mid = (n - 1) // 2
	ans = []
	k = 0
	while 0 <= mid <= n - 1:
		ans.append(arr[mid])
		if k > 0:
			k = -k - 1
		else:
			k = -k + 1
		mid += k
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	lst = []
	if n % 2:
		lst.append(a[n // 2])
		rht = n // 2 + 1
		lft = n // 2 - 1
	else:
		rht = n // 2
		lft = n // 2 - 1
	for i in range(n // 2):
		lst.append(a[rht])
		lst.append(a[lft])
		rht += 1
		lft -= 1
	print(*lst)


import sys, math
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr.sort()
	i = 0
	j = n - 1
	temp = []
	while i < j:
		temp.append(arr[j])
		temp.append(arr[i])
		j -= 1
		i += 1
	if i == j:
		temp.append(arr[j])
	print(' '.join(map(str, temp[::-1])))


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().strip().split()]
	a.sort()
	mid = n // 2
	l = mid - 1
	h = mid + 1
	c = 0
	res = []
	res.append(a[mid])
	turn = False
	while c != n - 1:
		if turn:
			res.append(a[h])
			h += 1
			turn = False
		else:
			res.append(a[l])
			l -= 1
			turn = True
		c += 1
	print(*res)


for i in range(int(input())):
	k = int(input()) // 2
	a = sorted(list(map(int, input().split())))
	q = []
	if len(a) % 2 == 0:
		for j in range(k, 0, -1):
			q.append(str(a[-j]))
			q.append(str(a[j - 1]))
	else:
		for j in range(k, -1, -1):
			q.append(str(a[j]))
			if j == 0:
				break
			q.append(str(a[-j]))
	print(' '.join(q))


for _ in range(int(input())):
	n = int(input())
	seq = sorted((int(x) for x in input().split()))
	ans = [0 for _ in range(n)]
	cnt_e = 0
	cnt_o = 0
	for i in range(n):
		if i % 2 == 0:
			ans[i] = str(seq[cnt_e])
			cnt_e += 1
		else:
			ans[i] = str(seq[-cnt_o - 1])
			cnt_o += 1
	print(' '.join(ans[::-1]))


def no_diamonds(n):
	return n

def problem1():
	print(no_diamonds(int(input())))

def sort_by_adjsum(a, b):
	l = len(a)
	if l == 1:
		return a + b
	else:
		return sort_by_adjsum(a[l // 2:], b[:(l - 1) // 2 + 1]) + sort_by_adjsum(a[:l // 2], b[(l - 1) // 2 + 1:])

def problem2():
	l = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = sort_by_adjsum(a[:l // 2], a[(l - 1) // 2 + 1:])
	if l % 2 == 1:
		b = [a[l // 2]] + b
	print(*b)
cases = int(input())
for _ in range(cases):
	problem2()


from math import ceil
for _ in range(int(input())):
	n = int(input())
	arr = sorted(map(int, input().split()))
	if n == 1:
		print(*arr)
	else:
		mid = int(n / 2)
		if n % 2 != 0:
			print(arr[mid], end=' ')
		for i in range(mid - 1, -1, -1):
			print(arr[i], end=' ')
			print(arr[n - i - 1], end=' ')


from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	ans = []
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - 1 - i])
	if n % 2 == 1:
		ans.append(a[n // 2])
	print(*ans[::-1])


from collections import Counter

def main():
	t = int(input())
	while t > 0:
		n = int(input())
		l = list(map(int, input().split()))
		res = []
		l.sort()
		for i in range(len(l) // 2):
			res.append(l[i])
			res.append(l[len(l) - 1 - i])
		if len(l) % 2 != 0:
			res.append(l[len(l) // 2])
		res.reverse()
		for x in res:
			print(x, end=' ')
		t -= 1
main()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	for i in range(n // 2):
		ans.append(l[i])
		ans.append(l[-i - 1])
	if n % 2 != 0:
		ans.append(l[n // 2])
	ans.reverse()
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	res = [0 for i in range(n)]
	j = n - 1
	for i in range(n - 1, -1, -2):
		res[i] = a[j]
		j -= 1
	j = 0
	for i in range(n - 2, -1, -2):
		res[i] = a[j]
		j += 1
	print(*res)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l = sorted(l)
	al = []
	j = n // 2 - 1
	for i in range(n // 2, n):
		al.append(l[i])
		al.append(l[j])
		j -= 1
	if n % 2 != 0:
		al.pop(-1)
	for i in al:
		print(i, end=' ')
	print(' ')


def solve():
	n = list(map(int, input().split()))
	n = int(n[0])
	v = list(sorted(map(int, input().split())))
	i = 0
	j = n - 1
	ans = []
	while i <= j:
		if i == j:
			ans.append(v[i])
			break
		else:
			ans.append(v[i])
			ans.append(v[j])
			i += 1
			j -= 1
	ans.reverse()
	for i in range(n):
		print(ans[i], end=' ')
	print()
t = input().split()
t = int(t[0])
for _ in range(t):
	solve()


test = int(input())
for temp in range(test):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 != 0:
		print(a[n // 2], end=' ')
	x = len(a) // 2 - 1
	y = x + 1
	if n % 2 != 0:
		y = x + 2
	while x >= 0:
		if y >= len(a):
			break
		print(a[x], a[y], end=' ')
		x -= 1
		y += 1
	print()


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		A = [int(x) for x in input().split()]
		A.sort()
		ans = []
		for i in range(N // 2):
			ans.append(A[-i - 1])
			ans.append(A[i])
		if N % 2 == 1:
			ans.append(A[N // 2])
		print(*reversed(ans))
main()


import sys, math

def binarySearch(arr, l, r, x):
	ans = -1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			ans = mid
			return ans
		elif arr[mid] < x:
			ans = mid
			l = mid + 1
		else:
			r = mid - 1
	return ans
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	l = 0
	r = n - 1
	ans = [0] * n
	for i in range(n - 1, -1, -1):
		if i & 1:
			ans[i] = a[r]
			r -= 1
		else:
			ans[i] = a[l]
			l += 1
	print(*ans)


def get_seq(array):
	if len(array) <= 2:
		yield from array
	else:
		sorted_array = sorted(array)
		median_index = len(sorted_array) // 2
		if len(sorted_array) % 2:
			yield sorted_array.pop(median_index)
		for i in range(median_index):
			yield sorted_array[median_index - i - 1]
			yield sorted_array[median_index + i]
n = int(input())
for _ in range(n):
	array_len = int(input())
	array = list(map(int, input().split()))
	assert len(array) == array_len
	seq = list(get_seq(array))
	print(*seq, sep=' ')


import sys

def process(A):
	sA = sorted(A)
	m = len(A) // 2
	s = str(sA[m])
	for i in range(1, len(sA) // 2):
		s += ' ' + str(sA[m - i])
		s += ' ' + str(sA[m + i])
	s += ' ' + str(sA[m - len(sA) // 2])
	if len(A) % 2 == 1:
		s += ' ' + str(sA[m + len(sA) // 2])
	print(s)
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def f(a, n):
	return True

def is_permutation(arr):
	for e in range(1, len(arr) + 1):
		if e not in arr:
			return False
	return True
t = inp()
for i in range(t):
	n = inp()
	A = inlt()
	process(A)


for t in range(int(input())):
	n = int(input())
	mas = sorted(list(map(int, input().split())))
	l = (n - 1) // 2
	r = (n - 1) // 2
	f = True
	for i in range(n):
		if f:
			print(mas[l], end=' ')
			r += 1
		else:
			print(mas[r], end=' ')
			l -= 1
		f = not f
	print()


from itertools import chain
I = input
for _ in range(int(I())):
	n = int(I())
	a = list(map(int, I().split()))
	a.sort()
	m = (n - 1) // 2
	r = []
	for i in range(m + (1 if n % 2 == 0 else 0)):
		r += [a[m - i], a[m + 1 + i]]
	if n % 2 != 0:
		r.append(a[0])
	print(*r)


def to_list(s):
	return list(map(lambda x: int(x), s.split(' ')))

def solve(a):
	if len(a) > 1:
		sorted_a = sorted(a)
		out_a = [0] * len(a)
		if len(a) % 2 == 0:
			for i in range(len(sorted_a) // 2):
				out_a[i * 2] = sorted_a[i]
				out_a[i * 2 + 1] = sorted_a[-i - 1]
		else:
			for i in range(len(sorted_a) // 2):
				out_a[i * 2] = sorted_a[i]
				out_a[i * 2 + 1] = sorted_a[-i - 1]
			out_a[-1] = sorted_a[len(a) // 2]
		print(' '.join(list(map(lambda x: str(x), out_a[::-1]))))
	else:
		print(str(a[0]))
t = int(input())
for i in range(t):
	n = int(input())
	a = to_list(input())
	solve(a)


import sys
import random
from math import log2, ceil
input = sys.stdin.readline

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

def primefs(n):
	if n == 1:
		return 1
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def int_array():
	return list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	x = 0
	y = n - 1
	for i in range(n):
		if i % 2 == 0:
			ans.append(a[y])
			y -= 1
		else:
			ans.append(a[x])
			x += 1
	print(*ans[::-1])


def main():
	t = int(input())
	for tt in range(t):
		n = int(input())
		l = list(map(int, input().split()))
		l.sort()
		t = []
		if n % 2:
			t.append(l[n // 2])
		for i in range(n // 2):
			t.append(l[n // 2 - i - 1])
			t.append(l[(n + 1) // 2 + i])
		print(*t)
main()


for _ in range(int(input())):
	x: int = int(input())
	arr = input().split(' ')
	arr = list(map(int, arr))
	arr.sort()
	print(arr[(x - 1) // 2], end=' ')
	for j in range(1, x // 2):
		print(arr[(x - 1) // 2 + j], end=' ')
		print(arr[(x - 1) // 2 - j], end=' ')
	if x % 2 == 1:
		print(arr[-1], end=' ')
		print(arr[0], end=' ')
	else:
		print(arr[-1], end=' ')


t = int(input())
for tt in range(t):
	n = int(input())
	arr = input().split()
	arr = [int(i) for i in arr]
	arr.sort()
	pointer = (n - 1) // 2
	jump = 1
	dir_ = 1
	for i in range(2, n + 2):
		print(arr[pointer], end=' ')
		pointer += dir_ * jump
		jump += 1
		dir_ *= -1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	index = n // 2
	if n % 2 == 0:
		index -= 1
	osc = 1
	d = 1
	ans = ''
	while i < n:
		ans += str(arr[index]) + ' '
		index = index + osc * d
		d *= -1
		osc += 1
		i += 1
	print(ans)


from sys import stdin
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, stdin.readline().split()))
	l.sort()
	a = []
	b = []
	ans = []
	if n % 2 == 0:
		c = n // 2 - 1
		d = c + 1
		while c >= 0:
			a.append(l[c])
			b.append(l[d])
			c -= 1
			d += 1
		for i in range(len(a)):
			ans.append(a[i])
			ans.append(b[i])
		print(*ans)
	else:
		c = n // 2
		d = c + 1
		while c >= 1:
			a.append(l[c])
			b.append(l[d])
			c -= 1
			d += 1
		for i in range(len(a)):
			ans.append(a[i])
			ans.append(b[i])
		ans.append(l[0])
		print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr1 = arr[:]
	arr2 = arr[:]
	arr1.sort()
	arr2.sort(reverse=True)
	liste = []
	if n % 2 != 0:
		for j in range(n - 1, n // 2, -1):
			liste.append(arr1[j])
			liste.append(arr2[j])
		liste.append(arr1[n // 2])
		print(*liste[::-1])
		continue
	for j in range(n - 1, n // 2 - 1, -1):
		liste.append(arr1[j])
		liste.append(arr2[j])
	print(*liste[::-1])


for _ in range(int(input())):
	l = int(input())
	a = list(map(int, input().split()))
	b = list()
	a.sort()
	if l % 2 == 0:
		i = 1
		a.insert(l // 2, 0)
		while i <= l // 2:
			b.append(a[l // 2 - i])
			b.append(a[l // 2 + i])
			i += 1
		print(*b)
	else:
		i = 1
		b.append(a[l // 2])
		while i <= l // 2:
			b.append(a[l // 2 - i])
			b.append(a[l // 2 + i])
			i += 1
		print(*b)


for _ in range(int(input())):
	x = int(input())
	(*li,) = map(int, input().split())
	li.sort()
	a = x // 2
	li1 = [li[a]]
	for i in range(1, a + 1):
		if a - i >= 0:
			li1.append(li[a - i])
		if a + i < x:
			li1.append(li[a + i])
	print(*li1)


T = int(input())
for t in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	A = sorted(A)
	i = 0
	j = len(A) - 1
	output = []
	while i <= j:
		if i == j:
			output.append(A[i])
		else:
			output.append(A[j])
			output.append(A[i])
		j -= 1
		i += 1
	output.reverse()
	for a in output:
		print(a, end=' ')
	print()


def helper(arr, n):
	arr.sort()
	if n % 2 == 0:
		midIdx = n // 2 - 1
	else:
		midIdx = n // 2
	ans = []
	for i in range(n // 2 + 1):
		idx = midIdx + i
		if idx < n and idx >= 0:
			ans.append(arr[idx])
		newIdx = midIdx - i
		if newIdx != idx and newIdx < n and (newIdx >= 0):
			ans.append(arr[newIdx])
	return ans
test = int(input())
for i in range(test):
	n = int(input())
	inputs = list(map(int, input().split()))
	ans = helper(inputs, n)
	for i in ans:
		print(i, end=' ')
	print('')


try:
	for i in range(int(input())):
		n = int(input())
		w = list(map(int, input().split()))
		w.sort()
		while w:
			print(w.pop(len(w) // 2), end=' ')
except:
	pass


import math
t = int(input())
for _ in range(t):
	b = input()
	a = list(map(int, input().split()))
	c = sorted(a)
	while c:
		print(c.pop(len(c) // 2), end=' ')


test = int(input())
while test > 0:
	test -= 1
	n = int(input())
	a = [int(x) for x in map(int, input().split())]
	a.sort()
	mid = (n - 1) // 2
	l = mid
	r = mid + 1
	ans = list()
	st = 0
	while n > 0:
		n -= 1
		if st == 0:
			ans.append(a[l])
			l -= 1
		else:
			ans.append(a[r])
			r += 1
		st = 1 - st
	ans = map(str, ans)
	print(' '.join(ans))


from sys import stdin, stdout
T = int(stdin.readline())
for i in range(T):
	N = int(stdin.readline())
	arr = stdin.readline().split()
	arr = list(map(int, arr))
	arr.sort()
	(l, r) = (0, len(arr) - 1)
	op = []
	while l < r:
		op.append(arr[r])
		op.append(arr[l])
		l += 1
		r -= 1
	if l == r:
		op.append(arr[l])
	for i in range(len(arr) - 1, -1, -1):
		stdout.write(str(op[i]) + ' ')
	stdout.write('\n')


import sys
T = int(input())
for _ in range(T):
	N = int(input())
	a = sorted(map(int, input().split()))
	l = 0
	r = N - 1
	res = []
	while l <= r:
		res.append(a[l])
		if l < r:
			res.append(a[r])
		l += 1
		r -= 1
	print(*res[::-1])


total_sets = int(input())

def diff_order(set):
	ordered_set = []
	set.sort()
	odd = len(set) % 2
	nel = len(set)
	half = len(set) // 2
	if odd:
		half += 1
	for j in range(0, half):
		if j == half - 1 and odd:
			ordered_set.append(set[j])
		else:
			ordered_set.append(set[nel - 1 - j])
			ordered_set.append(set[j])
	ordered_set.reverse()
	print(*ordered_set, sep=' ')
	return ordered_set
nset = []
set = []
for i in range(total_sets):
	nelements = int(input())
	nset.append(nelements)
	elements = input()
	el_list = []
	for el in elements.split():
		el_list.append(int(el))
	set.append(el_list)
for i in range(len(set)):
	diff_order(set[i])


for i in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l2 = []
	low = 0
	high = n - 1
	for i in range(n):
		if i % 2 == 0:
			l2.append(l[low])
			low += 1
		else:
			l2.append(l[high])
			high -= 1
	l2 = l2[::-1]
	print(*l2)


I = input
exec(int(I()) * 'I();a=I().split();a.sort(key=int)\nwhile a:print(a.pop(len(a)//2))\n')


t = int(input())
for _ in range(t):
	n = int(input())
	A = sorted(list(map(int, input().split())))
	res = []
	mid = n // 2
	res.append(A[mid])
	for i in range(1, mid):
		j = mid + -1 * i
		k = mid + i
		res.append(A[j])
		res.append(A[k])
	res.append(A[0])
	if n % 2 == 1:
		res.append(A[n - 1])
	print(*res)


import sys
import heapq

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

def iinput():
	return int(input())

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

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

def YES(flag):
	if flag:
		return 'YES'
	return 'NO'

def main():
	n = iinput()
	q = sorted(rlinput())
	res = []
	for i in range(n // 2):
		res.append(q[i])
		res.append(q[-1 - i])
	if n % 2:
		res.append(q[n // 2])
	print(*reversed(res))
for i in range(iinput()):
	main()


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ptr1 = 0
	ptr2 = n - 1
	lis = []
	for i in range(n):
		if i % 2 == 0:
			lis.append(arr[ptr2])
			ptr2 -= 1
		else:
			lis.append(arr[ptr1])
			ptr1 += 1
	print(*reversed(lis))


for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	li = []
	if n % 2 == 0:
		for i in range(n // 2):
			li.append(ar[i])
			li.append(ar[-(i + 1)])
	else:
		for i in range(n // 2):
			li.append(ar[i])
			li.append(ar[-(i + 1)])
		li.append(ar[n // 2])
	print(*li[::-1])


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	if n % 2 == 0:
		m = n // 2 - 1
		mb = m
		ma = m + 1
		while mb != -1 and ma != n:
			if mb >= 0:
				print(arr[mb], end=' ')
				mb -= 1
			if ma <= n - 1:
				print(arr[ma], end=' ')
				ma += 1
		print()
	else:
		m = n // 2
		mb = m - 1
		ma = m
		while mb != -1 and ma != n:
			if ma < n:
				print(arr[ma], end=' ')
				ma += 1
			if mb >= 0:
				print(arr[mb], end=' ')
				mb -= 1
		print(arr[-1], end=' ')
		print()


t = int(input())
while t > 0:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	i = (n - 1) // 2
	c = 0
	while i >= 0 and i < n:
		print(l[i], end=' ')
		c += 1
		if c % 2 == 0:
			i -= c
		else:
			i += c
	print()
	t -= 1


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

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

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	n = int(input())
	a = list(mapi())
	b = []
	a.sort()
	res = [0] * n
	i = 0
	j = n - 1
	for i in range(n // 2):
		res[j] = a[n - i - 1]
		res[j - 1] = a[i]
		j -= 2
	if n % 2 != 0:
		res[j] = a[n // 2]
	print(*res)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, vals, ans, x) = (int(input()), sorted([int(i) for i in input().split()]), [], None)
	if n % 2:
		(x, n) = (vals.pop(), n - 1)
	(l, r) = (n // 2 - 1, n // 2)
	for i in range(n // 2):
		ans.append(vals[r])
		ans.append(vals[l])
		(r, l) = (r + 1, l - 1)
	if x != None:
		ans.append(x)
	print(*ans)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	ls = sorted(map(int, stdin.readline().split()))
	x = len(ls) // 2
	r = 1
	while x != len(ls) and x != -1:
		stdout.write(str(ls[x]) + ' ')
		if r % 2 == 0:
			x += r
		else:
			x -= r
		r += 1
	print('')


for _ in range(int(input())):
	x = int(input())
	l = list(map(int, input().split()))
	l.sort()
	b = []
	for i in range(x // 2):
		b.extend([l[i], l[-i - 1]])
	if x % 2:
		b.append(l[x // 2])
	print(*b[::-1])


import sys
input = sys.stdin.readline
yo = input()
if yo[-1] == '\n':
	yo = yo[:-1]
t = int(yo)
for i in range(t):
	yo = input()
	if yo[-1] == '\n':
		yo = yo[:-1]
	n = int(yo)
	yo = input()
	if yo[-1] == '\n':
		yo = yo[:-1]
	l = list(map(int, yo.split()))
	l.sort()
	mid = n // 2
	if n % 2 == 0:
		mid -= 1
	sign = -1
	k = mid
	for j in range(n):
		print(l[k + sign * j], end=' ')
		k += sign * j
		sign *= -1
	print()


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')
t = int(input())
for _ in range(t):
	input()
	arr = list(sorted(map(int, input().split())))
	ans = list()
	(left, right, start_right) = (0, len(arr) - 1, True)
	while left <= right:
		if start_right:
			ans.append(arr[right])
			right -= 1
			start_right = False
		else:
			ans.append(arr[left])
			left += 1
			start_right = True
	print(*ans[::-1])


for i in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	ans1 = []
	for i in range(n // 2):
		ans1.append(str(A[i]))
		ans1.append(str(A[n - 1 - i]))
	if n % 2 != 0:
		ans1.append(str(A[n // 2]))
	s = ' '.join(ans1[::-1])
	print(s)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	p1 = 0
	p2 = n - 1
	a1 = []
	while p1 < p2:
		a1.append(a[p1])
		a1.append(a[p2])
		p1 += 1
		p2 -= 1
	if n % 2 == 1:
		a1.append(a[n // 2])
	for i in range(len(a1) - 1, -1, -1):
		print(a1[i], end=' ')
	print()


from math import floor
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if len(a) % 2 == 0:
		for i in range(len(a) // 2, n):
			print(a[n - i - 1], a[i], end=' ')
	else:
		print(a[len(a) // 2], end=' ')
		for i in range(len(a) // 2 + 1, n):
			print(a[n - i - 1], a[i], end=' ')
	print()


a = [0] * 100005
b = [0] * 100005
t = int(input())
while t != 0:
	n = int(input())
	a = input().split()
	for i in range(n):
		a[i] = int(a[i])
	a.sort()
	b[n - 1] = a[0]
	b[n - 2] = a[n - 1]
	for i in range(1, n // 2):
		if abs(int(b[n - 2 * i]) - int(a[n - i - 1])) > abs(int(b[n - 2 * i]) - int(a[i])):
			b[n - 2 * i - 1] = a[n - i - 1]
			b[n - 2 * i - 2] = a[i]
		else:
			b[n - 2 * i - 1] = a[i]
			b[n - 2 * i - 2] = a[n - i - 1]
	if n % 2 == 1:
		b[0] = a[n // 2]
	for i in range(n):
		print(b[i], end=' ')
		b[i] = 0
	print()
	t -= 1


for i in range(int(input())):
	s = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if s % 2 == 0:
		l = s // 2 - 1
		r = s // 2
		while l >= 0 and r < s:
			print(a[l], a[r], end=' ')
			l -= 1
			r += 1
	else:
		print(a[s // 2], end=' ')
		l = s // 2 - 1
		r = s // 2 + 1
		while l >= 0 and r < s:
			print(a[l], a[r], end=' ')
			l -= 1
			r += 1


t = int(input())
p = []
for i in range(t):
	r = []
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if len(a) % 2 == 0:
		b = a[:len(a) // 2]
		c = a[len(a) // 2:]
	else:
		b = a[:len(a) // 2 + 1]
		c = a[len(a) // 2 + 1:]
	b.reverse()
	if len(b) == len(c):
		for j in range(len(b)):
			r.append(b[j])
			r.append(c[j])
	else:
		for j in range(len(c)):
			r.append(b[j])
			r.append(c[j])
		r.append(b[-1])
	listToStr = ' '.join([str(elem) for elem in r])
	p.append(listToStr)
for i in range(len(p)):
	print(p[i])


import sys
from math import sqrt, floor
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def a():
	ans = ''
	for _ in range(int(inp())):
		ans += inp()
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		arr = deque(sorted(read()))
		arr2 = deque()
		for i in range(n // 2):
			arr2.appendleft(arr.pop())
			arr2.appendleft(arr.popleft())
		if arr:
			arr2.appendleft(arr.pop())
		print(*arr2)
b()


I = input
for _ in [0] * int(I()):
	I()
	a = sorted(map(int, I().split()))
	while a:
		print(a.pop(len(a) // 2))


t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	arr = list(map(int, input().strip().split()))
	arr.sort()
	ans = []
	if n & 1:
		ans.append(arr[n // 2])
		arr.pop(n // 2)
		n -= 1
	i = (n - 1) // 2
	dex = 0
	while dex + dex < n:
		ans.extend([arr[i - dex], arr[i + dex + 1]])
		dex += 1
	print(' '.join(map(str, ans)))


t = int(input())
for i in range(t):
	f = lambda : map(int, input().split(' '))
	n = int(input())
	a = list(f())
	b = []
	a.sort()
	if n % 2 != 0:
		b.append(a[n // 2])
		c = 2
		d = n // 2 + 1
		for i in range(d, n):
			b.append(a[i - c])
			b.append(a[i])
			c += 2
	else:
		c = 1
		d = n // 2
		for i in range(d, n):
			b.append(a[i - c])
			b.append(a[i])
			c += 2
	for i in b:
		print(i, end=' ')


from sys import stdin

def solve(n, a):
	a.sort()
	k = n // 2
	for i in range(n // 2, n - 1):
		print(a[i], end=' ')
		k -= 1
		print(a[k], end=' ')
	print(a[n - 1], end=' ')
	if k == 1:
		print(a[0])
	print()
	return

def main():
	inp = stdin.readline
	for _ in range(int(inp())):
		n = int(inp())
		a = list(map(int, inp().strip().split()))
		solve(n, a)
main()


import heapq as hp
import collections
import bisect
import math
import re

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int):
	return sorted(map(func, input().split()))

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

def range_n():
	return range(int(input()))

def getint():
	return int(input())

def counter(a):
	d = {}
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	return d

def main():
	for _ in range_n():
		n = getint()
		a = s_unpack()
		b = []
		i = 0
		while i < n // 2:
			b.append(a[i])
			b.append(a[n - i - 1])
			i += 1
		else:
			if n & 1:
				b.append(a[i])
		print(*b[::-1])
main()


def sortedAdjacentDifferences(arr):
	arr.sort()
	if len(arr) % 2 == 0:
		y = len(arr) // 2
		x = y - 1
		while x >= 0 and y <= len(arr) - 1:
			print(arr[x], arr[y], end=' ')
			x -= 1
			y += 1
	else:
		y = len(arr) // 2
		print(arr[y], end=' ')
		x = y - 1
		y = y + 1
		while x >= 0 and y <= len(arr) - 1:
			print(arr[x], arr[y], end=' ')
			x -= 1
			y += 1

def main():
	t = int(input())
	arr = []
	for i in range(t):
		input()
		arr = list(map(int, input().split()))
		sortedAdjacentDifferences(arr)
		arr.clear()
main()


t = int(input())
for i in range(t):
	n = int(input())
	ar = [int(i) for i in input().split()]
	ar.sort()
	boba = []
	co = False
	for x in range((n + 1) // 2):
		l = x
		r = n - x - 1
		boba.append(ar[l])
		if l != r:
			boba.append(ar[r])
	print(' '.join((str(i) for i in boba[::-1])))


I = input
exec(int(I()) * 'I();a=sorted(map(int,I().split()));print(*(a[(-i,i)[i%2]//2]for i in range(len(a),0,-1)));')


t = int(input())
for i in range(t):
	n = int(input())
	arr = map(int, input().split())
	ptr = sorted(list(arr))
	tmp = []
	length = len(ptr)
	if length % 2 == 1:
		for j in range(length // 2):
			tmp.append(ptr[j])
			tmp.append(ptr[length - 1 - j])
		tmp.append(ptr[length // 2])
	else:
		for j in range(length // 2):
			tmp.append(ptr[j])
			tmp.append(ptr[length - 1 - j])
	for m in range(length):
		print(tmp[length - m - 1], end='')
		if m != length - 1:
			print(' ', end='')
	if i != t - 1:
		print()


for _ in range(int(input())):
	na = int(input())
	lis = sorted(map(int, input().split()))
	ans = [0] * na
	i = 0
	j = na - 1
	k = na - 1
	while k > 0:
		ans[k] = lis[j]
		ans[k - 1] = lis[i]
		j -= 1
		i += 1
		k -= 2
	if na % 2 != 0:
		ans[0] = lis[na // 2]
	print(*ans)


tc = int(input())
for _ in range(tc):
	n = int(input())
	(*arr,) = map(int, input().split())
	arr.sort()
	i = 0
	j = len(arr) - 1
	ans = []
	while i <= j:
		ans.append(arr[i])
		i += 1
		if i > j:
			break
		ans.append(arr[j])
		j -= 1
	ans = ans[::-1]
	print(*ans)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(reverse=True)
	l = []
	for j in range(n // 2):
		l.append(a[j])
		l.append(a[n - j - 1])
	if n % 2 != 0:
		l.append(a[n // 2])
	l.reverse()
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(s) for s in input().split(' ')]
	a.sort()
	if len(a) % 2 == 1:
		middle = len(a) // 2
	else:
		middle = len(a) // 2 - 1
	forward = True
	rightmost_covered = middle
	leftmost_covered = middle
	print(a[middle], end=' ', flush=False)
	while True:
		if forward:
			current = rightmost_covered + 1
			if current >= len(a):
				break
			rightmost_covered += 1
			forward = False
		else:
			current = leftmost_covered - 1
			if current < 0:
				break
			leftmost_covered -= 1
			forward = True
		print(a[current], end=' ', flush=False)
	print(flush=False)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	arr.sort()
	ans = [0] * n
	for i in range(n // 2):
		ans[n - 1 - i * 2] = arr[i]
		ans[n - 1 - i * 2 - 1] = arr[n - 1 - i]
	if n % 2:
		ans[0] = arr[i + 1]
	for i in range(n):
		print(ans[i], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	if n % 2 != 0:
		x = n // 2
		print(l[x], end=' ')
		i = 1
		for i in range(1, n // 2 + 1):
			print(l[x + i], end=' ')
			print(l[x - i], end=' ')
		print()
	else:
		x = n // 2 - 1
		print(l[x], end=' ')
		for i in range(1, n // 2):
			print(l[x + i], end=' ')
			print(l[x - i], end=' ')
		print(l[x + n // 2])


a = int(input())
for i in range(a):
	b = int(input())
	c = list(map(int, input().split()))
	c.sort()
	ans = []
	if b % 2 == 0:
		li = b // 2 - 1
	else:
		li = b // 2
	ans.append(c[li])
	for k in range(1, b // 2 + 1):
		if li + k < b:
			ans.append(c[li + k])
		if li - k >= 0:
			ans.append(c[li - k])
	for jik in ans:
		print(jik, end=' ')
	print()


def printList(l):
	l_str = map(str, l)
	print(' '.join(l_str))
t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	nums = list(map(int, input().strip().split()))
	nums.sort()
	(s, acc, flag) = (n - 1 >> 1, 0, 1)
	ans = []
	while len(ans) < n:
		ans.append(nums[s])
		acc += 1
		s += acc * flag
		flag *= -1
	printList(ans)


import collections, math, bisect
local = False
if local:
	file = open('input.txt', 'r')
	import time

def inp():
	if local:
		return file.readline().rstrip()
	else:
		return input().rstrip()

def ints():
	return [int(_) for _ in inp().split()]
if local:
	start = time.time()
t = int(inp())
for _ in range(1, t + 1):
	n = int(inp())
	arr = [int(_) for _ in inp().split()]
	arr.sort(key=lambda x: x)
	(l, r) = (0, n - 1)
	res = [0] * n
	pos = n - 1
	while l < r:
		res[pos] = arr[r]
		res[pos - 1] = arr[l]
		pos -= 2
		r -= 1
		l += 1
	if l == r:
		res[0] = arr[l]
	print(' '.join([str(_) for _ in res]))
if local:
	fin = (time.time() - start) * 1000
	print('{:.2f}'.format(fin) + 'ms')


def read():
	n = int(input())
	a = list(map(int, input().split()))
	return (n, a)

def solve(n, a):
	a.sort()
	b = []
	index = n // 2
	left = True
	for i in range(n):
		b.append(a[index])
		index = index - (i + 1) if left else index + (i + 1)
		left = not left
	return b
for i in range(int(input())):
	result = solve(*read())
	print(*result)


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	ar = [int(x) for x in inp().split()]
	ar2 = []
	ar.sort()
	if n % 2 == 0:
		for i in range(n // 2):
			ar2.append(ar[n // 2 - i - 1])
			ar2.append(ar[n // 2 + i])
	else:
		ar2.append(ar[n // 2])
		for i in range(n // 2):
			ar2.append(ar[n // 2 - i - 1])
			ar2.append(ar[n // 2 + i + 1])
	print(*ar2)


import sys
import math
from collections import Counter
debug = 1
readln = sys.stdin.readline

def write(s):
	sys.stdout.write(str(s))

def writeln(s):
	sys.stdout.write(str(s))
	sys.stdout.write('\n')

def readint():
	return int(readln().strip())

def readints():
	return map(int, readln().split())

def readstr():
	return readln().strip()

def readstrs():
	return readln().split()

def dbg(*args):
	if debug:
		print(' '.join(map(str, args)))

def solve(n, A):
	A = sorted(A)
	mid = n // 2
	ret = [A[mid]]
	for i in range(1, n):
		valid = 0
		if mid - i >= 0:
			ret.append(A[mid - i])
			valid = 1
		if mid + i < n:
			ret.append(A[mid + i])
			valid = 1
		if not valid:
			return ret
	return 0
t = readint()
for _ in range(t):
	n = readint()
	A = readints()
	writeln(' '.join(map(str, solve(n, A))))


for t in range(int(input())):
	n = int(input())
	L = [int(X) for X in input().split()]
	L.sort()
	A = []
	if n % 2 == 0:
		for i in range(n // 2):
			A.append(L[n // 2 - 1 - i])
			A.append(L[n // 2 + i])
	else:
		A.append(L[n // 2])
		for i in range(1, n // 2 + 1):
			A.append(L[n // 2 - i])
			A.append(L[n // 2 + i])
	print(' '.join(map(str, A)))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	if n % 2 == 0:
		ki = n // 2 - 1
		ka = n // 2
		while ki >= 0 and ka < n:
			print(arr[ka], arr[ki], end=' ')
			ka += 1
			ki -= 1
		print()
	else:
		ki = n // 2 - 1
		ka = n // 2 + 1
		print(arr[n // 2], end=' ')
		while ki >= 0 and ka < n:
			print(arr[ka], arr[ki], end=' ')
			ka += 1
			ki -= 1
		print()


from collections import deque
T = int(input())
for t in range(T):
	N = int(input())
	a = input()
	a = list(map(int, a.split(' ')))
	a = deque(sorted(a))
	result = []
	while len(a) > 0:
		result.append(a.popleft())
		if len(a) > 0:
			result.append(a.pop())
	result = reversed(result)
	result = [str(x) for x in result]
	print(' '.join(result))


t = int(input())
for k in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	y = n // 2
	c = 1
	l = y - 1
	r = y + 1
	p = []
	p.append(a[y])
	for j in range(0, n - 1, 1):
		if c % 2 != 0:
			if l >= 0:
				p.append(a[l])
				l -= 1
		elif r < n:
			p.append(a[r])
			r += 1
		c += 1
	for i in range(0, n - 1, 1):
		print(p[i], end=' ')
	print(p[n - 1])


for _ in range(int(input())):
	n = int(input())
	m = int(n / 2)
	l = sorted(list(map(int, input().split(' '))))
	r = []
	p = -1
	for i in range(n):
		p *= -1
		m += i * p
		r.append(l[m])
	print(' '.join([str(i) for i in r]))


for ii in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	for i in range(1, n // 2 + 1):
		ans.append(arr[i - 1])
		ans.append(arr[n - i])
	if n % 2 != 0:
		ans.append(arr[i])
	print(*ans[::-1])


from collections import deque, defaultdict, Counter, OrderedDict
for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	mid = n // 2
	ans = []
	arr = deque(arr)
	while arr:
		if arr:
			ans.append(arr.popleft())
		if arr:
			ans.append(arr.pop())
	ans = ans[::-1]
	ans = list(map(str, ans))
	print(' '.join(ans))


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	left = 0
	right = n - 1
	l.sort()
	ans = []
	while left <= right:
		if left != right:
			ans.append(l[left])
		ans.append(l[right])
		left += 1
		right -= 1
	ans.reverse()
	print(*ans, sep=' ')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	i = 0
	d = []
	j = n - 1
	while i <= j:
		if i == j:
			d.append(l[i])
		else:
			d.append(l[i])
			d.append(l[j])
		i += 1
		j -= 1
	d.reverse()
	for i in d:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	lens = int(input())
	arrs = sorted([int(x) for x in input().split()])
	(a, b) = (arrs[lens // 2:], arrs[:lens // 2][::-1])
	for (x, y) in zip(a, b):
		print(x, y, end=' ')
	if lens % 2:
		print(arrs[-1])
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	i = n // 2 - 1
	j = i + 1
	while i > -1 or j < n:
		if j < n:
			print(a[j], end=' ')
			j += 1
		if i > -1:
			print(a[i], end=' ')
			i -= 1


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
t = int(input())
for i in range(t):
	n = int(input())
	l = list([int(x) for x in input().split()])
	l.sort()
	j = n // 2 - 1
	c = 1
	while j >= 0 and j + c < n:
		if n % 2 != 0 and n > 1 and (c == 1):
			print(l[j + 1], end=' ')
			c += 1
			continue
		print(l[j], l[j + c], end=' ')
		j -= 1
		c += 2
	print()


import math
from queue import LifoQueue

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

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

def instr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().strip().split())
t = inp()
for _ in range(t):
	n = inp()
	a = inlist()
	a = sorted(a)
	l = n
	if n % 2 != 0:
		l = n - 1
	mid = l // 2
	j = mid
	for i in range(mid - 1, -1, -1):
		print(a[j], a[i], end=' ')
		j += 1
	if l < n:
		print(a[l])


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


for f in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [0] * n
	i = n - 1
	big = 0
	foo = 0
	while i >= 0:
		if big == 1:
			b[i] = a[-foo]
			big = 0
		else:
			b[i] = a[foo]
			foo += 1
			big = 1
		i -= 1
	print(*b)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	w = sorted(map(int, input().split()))
	i = j = n // 2
	d = [w[i]]
	while True:
		if i > 0:
			i -= 1
			d.append(w[i])
		if j < n - 1:
			j += 1
			d.append(w[j])
		if i == 0 and j == n - 1:
			break
	print(' '.join(map(str, d)))


import math

def facts(n):
	ans = []
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			ans.append(i)
			ans.append(n // i)
	ans = sorted(ans)
	return ans
for _ in range(int(input())):
	n = int(input())
	nms = sorted(list(map(int, input().split())))
	(pnt1, pnt2) = (0, n - 1)
	ans = []
	if n % 2 == 1:
		while pnt1 <= pnt2:
			if pnt1 == pnt2:
				ans.append(str(nms[pnt1]))
			else:
				ans.append(str(nms[pnt2]))
				ans.append(str(nms[pnt1]))
			pnt2 -= 1
			pnt1 += 1
	else:
		while pnt1 < pnt2:
			ans.append(str(nms[pnt2]))
			ans.append(str(nms[pnt1]))
			pnt2 -= 1
			pnt1 += 1
	ans = ans[::-1]
	print(' '.join(ans))


import os
import sys
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')
for _ in range(int(input())):
	n = int(input())
	l = []
	lst = sorted(list(map(int, input().split())))
	(i, j) = (0, n - 1)
	while i <= j:
		l.append(lst[i])
		if i < j:
			l.append(lst[j])
		i = i + 1
		j = j - 1
	print(*l[::-1])


for _ in range(int(input())):
	n = [int(a) for a in input().split()]
	arr = [int(a) for a in input().split()]
	arr.sort(reverse=True)
	x1 = (len(arr) - 1) // 2
	x2 = (len(arr) - 1) // 2
	ans = [arr[x2]]
	d = False
	x1 -= 1
	x2 += 1
	for i in range(len(arr) - 1):
		if x1 >= 0 and d:
			ans.append(arr[x1])
			x1 -= 1
			d = False
		elif x2 < len(arr):
			ans.append(arr[x2])
			x2 += 1
			d = True
		else:
			d = True
	for x in ans:
		print(x, end=' ')
	print('')


from collections import deque
for _ in range(int(input())):
	n = int(input())
	ls = deque(sorted(list(map(int, input().split()))))
	ans = []
	while ls:
		b = ls.pop()
		ans.append(b)
		if ls:
			b = ls.popleft()
			ans.append(b)
	n -= 1
	while n >= 0:
		print(ans[n], end=' ')
		n -= 1
	print('')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 1:
		i = n // 2
		j = n // 2
		b = [a[i]]
		b.append(a[j - 1])
		j -= 1
		while i < n and j > -1:
			if len(b) == n:
				break
			if n // 2 - j <= i - n // 2:
				b.append(a[j - 1])
				j -= 1
			else:
				b.append(a[i + 1])
				i += 1
		print(*b)
	else:
		i = n // 2
		j = n // 2
		b = [a[i]]
		b.append(a[j - 1])
		j -= 1
		while i < n and j > -1:
			if len(b) == n:
				break
			if n // 2 - j <= i - n // 2:
				b.append(a[j - 1])
				j -= 1
			else:
				b.append(a[i + 1])
				i += 1
		print(*b)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	ll = []
	p = 0
	q = n - 1
	while p < q:
		ll.append(l[p])
		ll.append(l[q])
		p += 1
		q -= 1
	if n % 2 != 0:
		ll.append(l[p])
	ll.reverse()
	print(*ll)


t = int(input())
for k in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	z = []
	if n % 2 != 0:
		z.append(a[n // 2])
		i = n // 2 - 1
		j = n // 2 + 1
		while i >= 0 and j < n:
			z.append(a[i])
			z.append(a[j])
			i -= 1
			j += 1
		for i in z:
			print(i, end=' ')
	else:
		i = n // 2 - 1
		j = n // 2
		while i >= 0 and j < n:
			z.append(a[i])
			z.append(a[j])
			i -= 1
			j += 1
		for i in z:
			print(i, end=' ')


import bisect as bi
t = int(input())
ans = []
for x in range(t):
	n = int(input())
	l = sorted(list(map(int, input().split(' '))))
	small = l[0:int(n / 2)]
	big = l[int(n / 2):]
	for x in range(n):
		if x % 2 == 0:
			l[x] = big.pop(0)
		else:
			l[x] = small.pop(-1)
	ans.append(' '.join((str(elem) for elem in l)))
for elem in ans[:]:
	print(elem)


import sys

def main():
	res = ''
	input = sys.stdin.readline
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		a.sort()
		mid = n // 2
		sub_res = str(a[mid]) + ' '
		for i in range(1, mid + 1 if n % 2 != 0 else mid):
			sub_res += str(a[mid - i]) + ' ' + str(a[mid + i]) + ' '
		if n % 2 == 0:
			sub_res += str(a[0])
		res += sub_res + '\n'
	print(res)
main()


for ekbaar in range(1):
	for tin in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		b = list(a)
		b.sort()
		c = [-10000000000] * (len(b) + 1)
		for _ in range(len(b)):
			if _ < len(b) // 2:
				c[n - 2 * _ - 1] = b[_]
				b[_] = -100000000000
		if n % 2 == 0:
			i = 0
		else:
			i = 1
		for _ in range(len(b)):
			if b[_] != -100000000000:
				c[i] = b[_]
				i += 2
		if n % 2 == 1:
			for _ in range(1, len(c) - 1):
				print(c[_], end=' ')
			print(c[-1])
		else:
			for _ in range(len(c) - 2):
				print(c[_], end=' ')
			print(c[-2])


import sys, os, io
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
import math

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

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

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

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

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

def ws(s):
	sys.stdout.write(s + '\n')

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

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
t = 1
t = int(input())
for _ in range(t):
	n = ii()
	l = li()
	l.sort()
	ans = []
	x = n // 2 - abs(1 - n % 2) + 1
	ans.append(l[x - 1])
	y = x - 2
	while y >= 0:
		ans.append(l[x])
		ans.append(l[y])
		x += 1
		y -= 1
		if y == -1 and n % 2 == 0:
			ans.append(l[x])
			break
	print(*ans)


import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split(' ')))
		a.sort()
		temp = (n - 1) // 2
		print(a[temp], end=' ')
		low = temp - 1
		high = temp + 1
		chk = 0
		while low >= 0 and high < n:
			if chk == 0:
				print(a[high], end=' ')
				high += 1
				chk = 1
			else:
				print(a[low], end=' ')
				low -= 1
				chk = 0
		if low == 0:
			print(a[low])
		elif high == n - 1:
			print(a[high])
		else:
			print()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def answer(n, A):
	A.sort()
	l = []
	for i in range((n + 1) // 2):
		l.append(A[i])
		if i != len(A) - 1 - i:
			l.append(A[len(A) - 1 - i])
	return l[::-1]
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(*answer(n, arr))


t = int(input())
for _ in range(t):
	l = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	if l % 2 == 0:
		m = int(l / 2)
		for i in range(m):
			print(a[m + i], end=' ')
			if i == m - 1:
				print(a[m - i - 1])
			else:
				print(a[m - i - 1], end=' ')
	else:
		m = int(l / 2)
		print(a[m], end=' ')
		for i in range(1, m + 1):
			print(a[m + i], end=' ')
			if i == m:
				print(a[m - i])
			else:
				print(a[m - i], end=' ')


def ordena(lista, n):
	l = 0
	r = n - 1
	lista = sorted(lista)
	a = [0] * n
	for i in range(n - 1, -1, -1):
		if i % 2:
			a[i] = lista[l]
			l += 1
		else:
			a[i] = lista[r]
			r -= 1
	for i in range(n):
		print(a[i], end=' ')
	print()
testes = int(input())
for test in range(testes):
	n = int(input())
	lista = list(map(int, input().split()))
	ordena(lista, n)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	res = []
	for i in range(n // 2):
		res.append(arr[n - i - 1])
		res.append(arr[i])
	if n % 2 != 0:
		res.append(arr[n // 2])
	res.reverse()
	print(*res)


t = int(input())
for x in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	h = []
	g = n // 2 - 1
	if n % 2 == 1:
		g += 1
	h.append(a[g])
	for i in range(1, n):
		if 0 <= g + i < n:
			h.append(a[g + i])
		if 0 <= g - i < n:
			h.append(a[g - i])
	print(' '.join(map(str, h)))


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
import datetime
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	starttime = datetime.datetime.now()
	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 = [int(x) for x in input().split()]
		a = sorted(a)
		b = []
		mid = (n - 1) // 2
		b.append(a[mid])
		i = 1
		while True:
			b.append(a[mid + i])
			if len(b) == n:
				break
			b.append(a[mid - i])
			if len(b) == n:
				break
			i += 1
		print(*b)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

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

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	while l:
		print(l[len(l) // 2], end=' ')
		l.pop(len(l) // 2)
	print('\n')


for _ in range(int(input())):
	a = int(input())
	x = list(map(int, input().split()))
	x.sort()
	p = []
	if a % 2 == 0:
		for i in range(0, a // 2):
			p.append(x[i])
			p.append(x[len(x) - i - 1])
		p = p[::-1]
		print(*p)
	else:
		u = x[a // 2]
		x.pop(x.index(x[a // 2]))
		for i in range(0, len(x) // 2):
			p.append(x[i])
			p.append(x[len(x) - i - 1])
		p = p[::-1]
		p.insert(0, u)
		print(*p)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	temp = n // 2
	f = 0
	j = 1
	ans = []
	ans2 = []
	final = []
	if n % 2 == 1:
		temp += 1
	for i in range(temp - 1, -1, -1):
		ans.append(arr[i])
	for i in range(temp, n):
		ans2.append(arr[i])
	for i in range(len(ans2)):
		final += [ans[i], ans2[i]]
	if len(ans2) < len(ans):
		final.append(ans[len(ans) - 1])
	print(*final)


import sys
input = sys.stdin.buffer.readline

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

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	n = int(input())
	arr = I()
	arr.sort()
	mindist = arr[1] - arr[0]
	minidx = 0
	ans = [-1] * n
	j = n - 1
	l = 0
	r = n - 1
	while j >= 0:
		ans[j] = arr[l]
		l += 1
		j -= 1
		if j < 0:
			break
		ans[j] = arr[r]
		r -= 1
		j -= 1
	print(*ans)


T = int(input())
t = 0
while t < T:
	t += 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	odd = 0
	nn = n
	if n % 2 != 0:
		odd = 1
		oddpop = arr.pop(0)
		nn = n - 1
	start = nn // 2
	ans = ''
	cnt = 1
	for i in range(start, nn):
		ans += str(arr[start - cnt]) + ' ' + str(arr[start + cnt - 1]) + ' '
		cnt += 1
	if odd:
		ans += str(oddpop)
	print(ans)


T = int(input())
for i in range(T):
	n = int(input())
	nums = list(map(int, input().split()))
	nums.sort()
	ans = []
	if len(nums) % 2 == 0:
		for i in range(len(nums) // 2):
			ans.append(nums[len(nums) // 2 + i])
			ans.append(nums[len(nums) // 2 - i - 1])
	else:
		ans.append(nums[len(nums) // 2])
		for i in range(len(nums) // 2):
			ans.append(nums[len(nums) // 2 + i + 1])
			ans.append(nums[len(nums) // 2 - i - 1])
	print(' '.join(list(map(str, ans))))


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	arr.sort()
	if n % 2 == 0:
		ans.append(arr[int(n / 2) - 1])
		ans.append(arr[int(n / 2)])
		for i in range(1, int(n / 2)):
			ans.append(arr[int(n / 2) - i - 1])
			ans.append(arr[int(n / 2) + i])
	else:
		ans.append(arr[int(n / 2)])
		for i in range(1, int(n / 2) + 1):
			ans.append(arr[int(n / 2) - i])
			ans.append(arr[int(n / 2) + i])
	print(*ans, sep=' ')


import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations

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

def iinput():
	return int(input())

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

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	n = iinput()
	a = rlinput()
	a.sort()
	ans = []
	for i in range(n // 2):
		ans.append(a[-(i + 1)])
		ans.append(a[i])
	if n % 2:
		ans.append(a[n // 2])
	ans = ans[::-1]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	s = sorted([int(i) for i in input().split()])
	ans = []
	m = (n - 1) // 2
	for i in range(n):
		if not i % 2:
			ans += [s[m - i]]
			m -= i
		else:
			ans += [s[m + i]]
			m += i
	print(*ans)


for i in range(0, int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	while n:
		print(l.pop(n // 2), end=' ')
		n = n - 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	while len(a) != 0:
		print(a.pop(len(a) // 2), end=' ')


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	result = []
	j = 1
	x = n // 2
	if n % 2 == 0:
		for i in range(n // 2, n):
			result.append(a[i])
			result.append(a[x - j])
			j += 1
	else:
		result.append(a[n // 2])
		for i in range(n // 2 + 1, n):
			result.append(a[i])
			result.append(a[x - j])
			j += 1
	print(*result)


for T in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	lis = [0] * n
	i = n - 1
	while i >= 0:
		a = arr.pop()
		lis[i] = a
		if len(arr) > 0:
			b = arr.pop(0)
			lis[i - 1] = b
		i -= 2
	for i in range(n):
		print(lis[i], end=' ')
	print('\n', end='')


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

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve(n, a):
	a.sort()
	sol = []
	idx = n // 2
	if n % 2 == 0:
		idx -= 1
	inc = 0
	side = -1
	for i in range(n):
		idx += inc * side
		sol.append(str(a[idx]))
		inc += 1
		side = -1 if side == 1 else 1
	return sol
t = read_int()
for case in range(t):
	n = read_int()
	a = read_ints()
	sol = solve(n, a)
	print(' '.join(sol))


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

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

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	n = int(z())
	l = szzz()
	t = (n + 1) // 2
	(x1, x2) = (0, 0)
	for i in range(n):
		if i % 2 == 1:
			print(l[t + x1])
			x1 += 1
		else:
			print(l[t - x2 - 1])
			x2 += 1


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	x = n // 2
	value = list()
	if n % 2 == 0:
		L1 = A[:x]
		L1.reverse()
		L2 = A[x:]
		for i in range(x):
			value.append(L1[i])
			value.append(L2[i])
	else:
		L1 = A[:x]
		L1.reverse()
		L2 = A[x:]
		for i in range(x):
			value.append(L2[i])
			value.append(L1[i])
		value.append(L2[x])
	print(*value)


from sys import stdout, stdin
(_input, _print) = (stdin.buffer.readline, stdout.write)
(_int, _range) = (int, range)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		arr = [_int(i) for i in _input().split()]
		arr.sort()
		midle = n // 2
		ans = [arr[midle]]
		index = 1
		while midle - index >= 0 or midle + index < n:
			if midle - index >= 0:
				ans.append(arr[midle - index])
			if midle + index < n:
				ans.append(arr[midle + index])
			index += 1
		print(*ans)
solution()


k = int(input())
for _ in range(k):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [0] * n
	k = n - 1
	i = 0
	j = n - 1
	while i < j and k - 1 >= 0:
		b[k] = a[j]
		b[k - 1] = a[i]
		j -= 1
		i += 1
		k = k - 2
	if n % 2 == 1:
		b[0] = a[int(n / 2)]
	print(*b)


from math import *
import threading
import sys
from collections import *
import itertools
sys.setrecursionlimit(300000)
mod = 10 ** 9
inf = 10 ** 15
yes = 'YES'
no = 'NO'
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')

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def dist(a, b):
	d = abs(a[1] - b[1]) + abs(a[2] - b[2])
	return d

def power_of_n(x, n):
	cnt = 0
	while x % n == 0:
		cnt += 1
		x //= n
	return cnt

def ask(l, r):
	if l == r:
		return -1
	print('?', l, r)
	sys.stdout.flush()
	return int(input())
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	(l, r) = (0, n - 1)
	while l < r:
		ans.append(a[r])
		ans.append(a[l])
		l += 1
		r -= 1
	if l == r:
		ans.append(a[r])
	ans.reverse()
	print(*ans)


from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
while t > 0:
	n = int(input())
	a = [int(x) for x in input().split()]
	b = []
	for i in range(n):
		b.append(0)
	a.sort()
	i = n // 2
	j = 0
	while i < n:
		b[j] = a[i]
		i += 1
		j += 2
	i = n // 2 - 1
	j = 1
	while i >= 0:
		b[j] = a[i]
		i -= 1
		j += 2
	for i in range(n):
		print(b[i], end=' ')
	print()
	t -= 1


def rearrange(arr, n):
	temp = n * [None]
	(small, large) = (0, n - 1)
	flag = True
	for i in range(n):
		if flag is True:
			temp[i] = arr[large]
			large -= 1
		else:
			temp[i] = arr[small]
			small += 1
		flag = bool(1 - flag)
	for i in range(n):
		arr[i] = temp[i]
	return arr
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	rearrange(arr, n)
	print(*arr[::-1])


t = int(input())
for i in range(t):
	n = int(input())
	array = [int(s) for s in input().split()]
	array = sorted(array)
	ans = []
	i = len(array) // 2
	j = len(array) // 2 - 1
	while i < len(array) and j > -1:
		ans.append(array[i])
		ans.append(array[j])
		i += 1
		j -= 1
	if i != len(array):
		ans.append(array[-1])
	if j != -1:
		ans.append(array[0])
	print(' '.join((str(s) for s in ans)))


tc = int(input())
while tc:
	tc -= 1
	n = int(input())
	v = list(map(int, input().split()))
	v.sort()
	p = []
	g = []
	for i in range(len(v)):
		if i < len(v) // 2:
			p.append(v[i])
		else:
			g.append(v[i])
	p.reverse()
	j = 0
	for i in range(1, len(v), 2):
		if j > len(p):
			break
		v[i] = p[j]
		j += 1
	j = 0
	for i in range(0, len(v), 2):
		if j > len(g):
			break
		v[i] = g[j]
		j += 1
	for i in v:
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	As = list(map(int, input().split()))
	As.sort()
	left = 0
	right = n - 1
	res = []
	while left <= right:
		if left == right:
			res.append(As[left])
			break
		res.append(As[right])
		res.append(As[left])
		right -= 1
		left += 1
	print(' '.join(map(str, res[::-1])))


from collections import deque
t = int(input())
while t > 0:
	n = int(input())
	arr = list(map(int, input().split()))
	d = deque(sorted(arr))
	ans = []
	while d:
		ans.append(d.pop())
		if d:
			ans.append(d.popleft())
	print(' '.join([str(i) for i in ans[::-1]]))
	t -= 1


import sys
input = sys.stdin.readline

def printlist(l):
	for i in l:
		print(i, end=' ')
	print()
t = int(input())
for r in range(t):
	n = int(input())
	templ = list(map(int, input().split()))
	templ.sort()
	i = 0
	j = n - 1
	ans = []
	while i < j:
		ans.append(templ[j])
		ans.append(templ[i])
		i += 1
		j -= 1
	if i == j:
		ans.append(templ[i])
	ans.reverse()
	printlist(ans)


t = int(input())
ans = [[] for x in range(t)]
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	for j in range(n):
		if j % 2 == 1:
			ans[i].append(a[(n - 1) // 2 + (j + 1) // 2])
		else:
			ans[i].append(a[(n - 1) // 2 - (j + 1) // 2])
for x in ans:
	print(' '.join(map(str, x)))


import sys

def solve(A):
	A.sort()
	N = len(A)
	result = []
	start = N // 2
	result.append(A[start])
	for i in range(1, N // 2 + 1):
		if 0 <= start - i < N:
			result.append(A[start - i])
		if 0 <= start + i < N:
			result.append(A[start + i])
	return ' '.join(map(str, result))
t = int(input())
for _ in range(t):
	n = int(input())
	A = [int(x) for x in sys.stdin.readline().split(' ')]
	print(solve(A))


from sys import stdin

def solve(n, A):
	A.sort()
	(ans, lo) = ([], n // 2 - 1 if n % 2 == 0 else n // 2)
	hi = lo + 1
	while lo >= 0 or hi < n:
		if lo >= 0:
			ans.append(A[lo])
		if hi < n:
			ans.append(A[hi])
		(lo, hi) = (lo - 1, hi + 1)
	return ans

def main():
	r = stdin.readline
	cases = int(r())
	for case in range(cases):
		n = int(r())
		A = list(map(int, r().strip().split()))
		print(*solve(n, A))
main()


t = int(input())
for i in range(t):
	n = input()
	k = [int(i) for i in input().split()]
	k.sort()
	cur = len(k) // 2 - 1
	if len(k) % 2 != 0:
		print(k[len(k) // 2], end=' ')
	flip = True
	while cur >= 0:
		if flip:
			print(k[cur], end=' ')
			print(k[len(k) - cur - 1], end=' ')
		else:
			print(k[len(k) - cur - 1], end=' ')
			print(k[cur], end=' ')
		cur -= 1
	print()


num = int(input())
t = 0
while t < num:
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	i = 0
	j = len(a) - 1
	ans = []
	while i <= j:
		if i == j:
			ans.append(a[i])
			i = i + 1
		else:
			ans.append(a[i])
			ans.append(a[j])
			i = i + 1
			j = j - 1
	for i in reversed(ans):
		print(i, end=' ')
	t = t + 1


t = int(input())
for tests in range(t):
	n = int(input())
	sp = list(map(int, input().split()))
	sp.sort()
	e = n // 2
	vp = 0
	vl = 0
	if n % 2 == 1:
		vp = 1
	else:
		vl = 0
	print(sp[e], end=' ')
	countvp = 0
	countvl = 0
	i = 0
	while i < n - 1:
		if vp == 1:
			countvp += 1
			vl = 1
			vp = 0
			p = e + countvp
			if p < n:
				print(sp[p], end=' ')
				i += 1
		else:
			countvl += 1
			vp = 1
			vl = 0
			p = e - countvl
			if p >= 0:
				print(sp[p], end=' ')
				i += 1
	print()


import sys
import io, os
import math

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = [int(i) for i in input().split()]
		a.sort()
		ans = []
		if n % 2 == 0:
			for i in range(n // 2):
				ans.append(a[n // 2 - i - 1])
				ans.append(a[n // 2 + i])
		elif a[n // 2] - a[n // 2 - 1] > a[n // 2 + 1] - a[n // 2]:
			for i in range(n // 2):
				ans.append(a[n // 2 - i])
				ans.append(a[n // 2 + i + 1])
			ans.append(a[0])
		else:
			for i in range(n // 2):
				ans.append(a[n // 2 + i])
				ans.append(a[n // 2 - i - 1])
			ans.append(a[-1])
		print(*ans)
main()


def solve(a):
	a.sort()
	mid = len(a) // 2
	y = 1
	ret = []
	ret.append(a[mid])
	while y < len(a) // 2 + 1:
		if mid - y >= 0:
			ret.append(a[mid - y])
		if mid + y < len(a):
			ret.append(a[mid + y])
		y += 1
	print(*ret)

def main():
	t = int(input())
	for _ in range(t):
		_ = input()
		a = [int(x) for x in input().split()]
		solve(a)
main()


t = int(input())

def print_arranged(l):
	res = ['0' for _ in range(len(l))]
	half = int(len(l) / 2)
	idx = len(l) - 1
	for i in range(half):
		res[idx] = l[-1 - i]
		res[idx - 1] = l[i]
		idx -= 2
	if len(l) % 2 == 1:
		res[0] = l[half]
	return res

def print_list(l):
	print(str(l)[1:-1].replace(',', ''))
for i in range(t):
	n = int(input())
	a = [int(_) for _ in input().split(' ')]
	a.sort()
	print_list(print_arranged(a))


for _ in range(int(input())):
	n = int(input())
	a = sorted([int(x) for x in input().split()])
	b = []
	for i in range(n // 2):
		b.append(a[i])
		b.append(a[n - 1 - i])
	if n % 2 > 0:
		b.append(a[n // 2])
	print(*b[::-1])


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		i = n // 2 - 1
	else:
		i = n // 2
	an = a[i + 2:]
	an2 = a[:i]
	ans = [a[i], a[i + 1]]
	k = 1
	i = len(an2) - 1
	j = 0
	while i > -1 or j < len(an):
		if k:
			ans.append(an2[i])
			i -= 1
		else:
			ans.append(an[j])
			j += 1
		k ^= 1
	print(*ans)


def read():
	n = int(input())
	a = list(map(int, input().split()))
	return (n, a)

def solve(n, a):
	a.sort()
	b = []
	i1 = i2 = n // 2
	left = n % 2 == 0
	for i in range(n):
		if left:
			b.append(a[i1])
			i2 -= 1
		else:
			b.append(a[i2])
			i1 += 1
		left = not left
	return b
for i in range(int(input())):
	result = solve(*read())
	print(*result)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	ans = []
	for i in range(n // 2 + n % 2):
		if n % 2 != 0 and i == n // 2:
			ans.append(a[i])
		else:
			ans.append(a[n - i - 1])
			ans.append(a[i])
	print(*ans[::-1])


for _ in range(int(input())):
	n = int(input())
	arr = [0] * n
	i = 0
	j = n - 1
	l = sorted(map(int, input().split()))
	for k in range(n - 1, 0, -2):
		arr[k] = l[j]
		arr[k - 1] = l[i]
		i += 1
		j -= 1
	if n % 2:
		arr[0] = l[j]
	for q in arr:
		print(q, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	mid = n // 2
	if n % 2 == 0:
		for i in range(0, n // 2, 1):
			print(a[n - mid + i], end=' ')
			print(a[n - mid - i - 1], end=' ')
	else:
		print(a[mid], end=' ')
		for i in range(1, n // 2 + 1, 1):
			print(a[n - mid - 1 - i], end=' ')
			print(a[n - mid + i - 1], end=' ')


for _ in range(int(input())):
	n = int(input())
	ls = sorted(list(map(int, input().split())))
	mid = n // 2
	if n % 2 == 0:
		mid -= 1
	i = mid - 1
	turn = True
	j = mid + 1
	ar = []
	ar.append(ls[mid])
	while i >= 0 or j < n:
		if turn and j < n:
			ar.append(ls[j])
			j += 1
		elif not turn and i >= 0:
			ar.append(ls[i])
			i -= 1
		turn = not turn
	print(*ar)


for _ in range(int(input())):
	n = int(input())
	m = n
	arr = list(map(int, input().split()))
	n = n // 2
	small = arr.copy()
	arr.sort(reverse=True)
	small.sort()
	result = []
	for i in range(n):
		result.append(arr[i])
		result.append(small[i])
	if m % 2 == 1:
		result.append(arr[n])
	result = result[::-1]
	print(*result)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	l = n // 2 - 1
	r = n // 2
	for i in range(0, n // 2):
		print(arr[r], arr[l], end=' ')
		l -= 1
		r += 1
	if n % 2 == 1:
		print(arr[n - 1], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = list(sorted(a))
	if n % 2 == 0:
		mid = n // 2 - 1
		i = mid
		j = mid + 1
		while i >= 0 and j < n:
			print(a[i], a[j], end=' ')
			i -= 1
			j += 1
		print()
	else:
		mid = n // 2
		i = mid
		j = mid + 1
		while i >= 0 and j < n:
			print(a[i], a[j], end=' ')
			i -= 1
			j += 1
		if i == 0 and j == n:
			print(a[i])
		if j == n - 1 and i == 0:
			print(a[j])


def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	while len(arr) != 0:
		mid = len(arr) // 2
		print(arr.pop(mid), end=' ')
	print()
t = int(input())
for _ in range(t):
	solve()


def ajd(arr):
	arr = sorted(arr)
	i = (len(arr) - 1) // 2
	j = i + 1
	res = []
	while i >= 0 or j < n:
		if i >= 0:
			res.append(arr[i])
			i -= 1
		if j < n:
			res.append(arr[j])
			j += 1
	res = [str(r) for r in res]
	return ' '.join(res)
ts = int(input())
for t in range(ts):
	n = int(input())
	arr = list(map(int, input().split()))
	print(ajd(arr))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	c = n - 1
	for j in range(n // 2):
		ans.append(a[j])
		ans.append(a[j + c])
		c -= 2
	if n % 2 != 0:
		ans.append(a[n // 2])
	final = []
	final = ans[::-1]
	print(*final)


t = int(input())
for _ in range(t):
	n = int(input())
	A = sorted(map(int, input().split()))
	arr = []
	for i in range(n // 2):
		arr.append(A[n - i - 1])
		arr.append(A[i])
	if n % 2 == 1:
		arr.append(A[n // 2])
	print(' '.join(map(str, reversed(arr))))


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

def solve(a):
	a.sort()
	l = len(a)
	b = []
	tmp1 = l // 2
	tmp2 = 1
	sign = -1
	for _ in range(l):
		b.append(a[tmp1])
		tmp1 += sign * tmp2
		tmp2 += 1
		sign = -sign
	print(' '.join(map(str, b)))

def main():
	t = int(input())
	for i in range(t):
		_ = int(input())
		a = list(map(int, input().split()))
		solve(a)
main()


def main():
	for t in range(int(input().strip())):
		n = int(input().strip())
		l = [int(j) for j in input().split()]
		l = sorted(l)
		m = []
		if n % 2 == 1:
			m.append(l[n // 2])
			for j in range(1, n // 2 + 1):
				m.append(l[n // 2 - j])
				m.append(l[n // 2 + j])
		if n % 2 == 0:
			for j in range(1, n // 2 + 1):
				m.append(l[n // 2 - j])
				m.append(l[n // 2 + j - 1])
		print(' '.join(map(str, m)))
main()


import sys
input = sys.stdin.buffer.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = a[:n // 2]
	c = a[n // 2:]
	ans = [0] * n
	for i in range(0, n, 2):
		ans[i] = c[i // 2]
	for i in range(1, n, 2):
		ans[i] = b.pop()
	print(*ans)


import sys

def solve(arr):
	sol = []
	if len(arr) % 2 == 1:
		i = len(arr) // 2
		j = len(arr) // 2
	else:
		i = len(arr) // 2 - 1
		j = len(arr) // 2
	while i != -1 and j != len(arr):
		if i == j:
			sol.append(arr[i])
		else:
			sol.append(arr[i])
			sol.append(arr[j])
		i -= 1
		j += 1
	return sol

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line)
	for i in range(len(q)):
		q[i] = q[i].rstrip().split(' ')
		q[i] = [int(x) for x in q[i]]
	for i in range(2, len(q), 2):
		q[i].sort()
		sol = solve(q[i])
		print(' '.join(map(str, sol)))
main()


t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	res = []
	l.sort()
	if n % 2 == 0:
		i = n // 2 - 1
		j = n // 2
		while i >= 0:
			res.append(l[i])
			res.append(l[j])
			i -= 1
			j += 1
	else:
		res.append(l[n // 2])
		i = n // 2 - 1
		j = n // 2 + 1
		while i >= 0:
			res.append(l[i])
			res.append(l[j])
			i -= 1
			j += 1
	print(*res)
	t -= 1


import sys

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

def mdata():
	return map(int, data().split())
ans = []
for i in range(int(data())):
	n = int(data())
	A = list(mdata())
	A.sort()
	ans1 = []
	for i in range(n // 2):
		ans1.append(str(A[i]))
		ans1.append(str(A[n - 1 - i]))
	if n % 2 != 0:
		ans1.append(str(A[n // 2]))
	s = ' '.join(ans1[::-1])
	ans.append(s)
print('\n'.join(ans))


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

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

def solve():
	n = read_int()
	a = read_ints()
	a.sort()
	ans = []
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - 1 - i])
	if n % 2 == 1:
		ans.append(a[n // 2])
	return ' '.join(map(str, ans[::-1]))
T = read_int()
for _ in range(T):
	print(solve())


n = int(input())
for _ in range(n):
	m = int(input())
	a = [int(v) for v in input().split()]
	a.sort()
	ans = []
	for i in range(m // 2):
		ans.append(a[i])
		ans.append(a[-1 - i])
	if m % 2 == 1:
		ans.append(a[m // 2])
	ans.reverse()
	print(*ans)


def main():
	for _ in range(int(input())):
		n = int(input())
		a = sorted(list(map(int, input().split())))
		(first, last) = (0, n - 1)
		result = list()
		while first < last:
			result += [a[last]]
			result += [a[first]]
			first += 1
			last -= 1
		if first == last:
			result += [a[first]]
		print(*result[::-1])
main()


for _ in range(int(input())):
	take = 0
	input()
	arr = [int(x) for x in input().split()]
	arr.sort()
	ans = []
	while arr:
		ans.append(arr.pop(take))
		if take:
			take = 0
		else:
			take = -1
	print(*reversed(ans))


t = int(input())
for i in range(t):
	n = int(input())
	numbers = list(map(int, input().split()))
	numbers.sort()
	middle = n // 2
	counter = 0
	arr = []
	flag = True
	while counter < n:
		if flag:
			arr.append(numbers[middle + counter])
			middle += counter
			counter += 1
			flag = False
		else:
			arr.append(numbers[middle - counter])
			middle -= counter
			counter += 1
			flag = True
	print(*arr)


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = 0
	r = n - 1
	ans = []
	while l < r:
		ans.append(a[l])
		ans.append(a[r])
		l += 1
		r -= 1
	if l == r:
		ans.append(a[l])
	ans.reverse()
	print(*ans)
	t -= 1


import os
import sys
from io import BytesIO, IOBase

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

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

def main():
	T = iin()
	while T:
		T -= 1
		n = iin()
		a = lin()
		a.sort()
		ans = []
		(l, r) = (0, n - 1)
		while l < r:
			ans.append(a[l])
			ans.append(a[r])
			l += 1
			r -= 1
		if l == r:
			ans.append(a[l])
		ans = ans[::-1]
		print(*ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def solve():
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	mid = n // 2
	ans = []
	add = ans.append
	add(l[mid])
	if n % 2:
		for i in range(1, n):
			if 0 <= mid + i < n:
				add(l[mid + i])
			if 0 <= mid - i < n:
				add(l[mid - i])
	else:
		for i in range(1, n):
			if 0 <= mid - i < n:
				add(l[mid - i])
			if 0 <= mid + i < n:
				add(l[mid + i])
	for i in range(n):
		print(ans[i], end=' ')
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	out = []
	if n % 2:
		out.append(a[n // 2])
		for x in range(n // 2):
			out.append(a[n // 2 + 1 + x])
			out.append(a[n // 2 - 1 - x])
	else:
		for x in range(n // 2):
			out.append(a[n // 2 + x])
			out.append(a[n // 2 - 1 - x])
	print(*out)


import sys
import random
input = sys.stdin.readline
testnumber = int(input())
for tn in range(1, testnumber + 1):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort(key=lambda x: -x)
	ans = [0] * n
	(i, j) = (0, len(a) - 1)
	z = len(a)
	while i <= j:
		z -= 1
		if (i + j) % 2:
			ans[z] = a[i]
			i += 1
		else:
			ans[z] = a[j]
			j -= 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	res = [None] * n
	if n % 2 == 0:
		left = n // 2 - 1
		right = n // 2
		i = 0
	else:
		left = n // 2 - 1
		right = n // 2 + 1
		res[0] = arr[n // 2]
		i = 1
	while left >= 0 and right < n:
		res[i] = arr[left]
		left -= 1
		i += 1
		res[i] = arr[right]
		right += 1
		i += 1
	print(*res)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	a.sort(reverse=1)
	ans = []
	for i in range(n // 2):
		ans += [a[i], a[n - i - 1]]
	if n & 1:
		ans += [a[n // 2]]
	print(*ans[::-1])


t = int(input())
for _ in range(t):
	input()
	mylist = list(map(int, input().split()))
	mylist.sort()
	for i in range(0, len(mylist)):
		print(mylist[len(mylist) // 2], end=' ')
		mylist.pop(len(mylist) // 2)


T = int(input())
for t in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ret = []
	for i in range(len(arr) // 2):
		ret.append(arr[i])
		ret.append(arr[n - i - 1])
	if n % 2 == 1:
		ret.append(arr[len(arr) // 2])
	print(' '.join(map(str, reversed(ret))))


T = int(input())
for _ in range(0, T):
	n = int(input())
	s = [int(x) for x in input().split()]
	s.sort()
	ptr = n // 2
	c = 0
	tt = 0
	while c < n:
		c += 1
		print(s[ptr], end=' ')
		if tt % 2 == 0:
			ptr -= c
		else:
			ptr += c
		tt += 1
	print(' ')


def solve(a):
	a.sort()
	(i, j) = (0, len(a) - 1)
	sol = []
	while i <= j:
		sol.append(a[i])
		i += 1
		if i <= j:
			sol.append(a[j])
			j -= 1
	return reversed(sol)
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	print(' '.join(map(str, solve(a))))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	ans = []
	ans.append(arr[0])
	p1 = 1
	p2 = n - 1
	while p2 >= p1:
		if abs(ans[-1] - arr[p1]) > abs(ans[-1] - arr[p2]):
			ans.append(arr[p1])
			p1 += 1
		else:
			ans.append(arr[p2])
			p2 -= 1
	ans.reverse()
	print(*ans)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	arr.sort()
	ans = []
	for i in range(n):
		if i % 2 == 0:
			ans.append(arr[i // 2])
		else:
			ans.append(arr[n - 1 - i // 2])
	print(' '.join(map(str, reversed(ans))))


test = int(input())
for i in range(test):
	arr_size = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	(i, j) = (0, arr_size - 1)
	final = []
	while i < j:
		final.append(arr[j])
		final.append(arr[i])
		i += 1
		j -= 1
	if i == j:
		final.append(arr[i])
	for i in reversed(range(arr_size)):
		print(final[i], end=' ')
	print()


def fun(ls, n):
	st = sorted(ls)
	index = 0
	ans = []
	left = 0
	right = len(st) - 1
	while left <= right:
		if left != right:
			ans.append(st[right])
			ans.append(st[left])
			left += 1
			right -= 1
		else:
			ans.append(st[right])
			left += 1
			right -= 1
	print(*ans[::-1])
T = int(input())
for i in range(T):
	n = int(input())
	ls = list(map(int, input().split()))
	fun(ls, n)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	a = inputlist()
	a.sort()
	b = []
	for i in range(n // 2):
		b.append(a[n - 1 - i])
		b.append(a[i])
	if n % 2 == 1:
		b.append(a[n // 2])
	b.reverse()
	print(*b)


t = int(input())
for x in range(t):
	n = int(input())
	a = list(sorted(list(map(int, input().split()))))
	b = [0] * n
	for i in range(n // 2):
		b[2 * i] = a[i]
		b[2 * i + 1] = a[-i - 1]
	if n % 2 == 1:
		b[-1] = a[n // 2]
	print(' '.join(list(reversed(list(map(str, b))))))


import math

def ord_binaria(vet):
	indx = math.floor((len(vet) - 1) / 2)
	result = [0] * len(vet)
	result[0] = vet[indx]
	for i in range(1, len(vet)):
		if i % 2 != 0:
			indx += i
		else:
			indx -= i
		result[i] = vet[indx]
	return result

def printa(v):
	for i in range(len(v)):
		if i == len(v) - 1:
			print(v[i])
		else:
			print(v[i], end=' ')

def program():
	t = int(input())
	for _ in range(t):
		input()
		v = [int(i) for i in input().split()]
		v.sort()
		printa(ord_binaria(v))
program()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	ans = [0] * n
	i = 0
	if n & 1:
		ans[0] = a[n >> 1]
		i = 1
	for (j, k) in zip(range((n >> 1) - 1, -1, -1), range(n + 1 >> 1, n)):
		ans[i] = a[j]
		ans[i + 1] = a[k]
		i += 2
	print(*ans)


mod = 10 ** 9 + 7
import math
from bisect import bisect_left
from collections import Counter
from itertools import combinations

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

def fain():
	return map(float, input().split())

def mc2(s):
	return s * (s - 1) // 2 + s
for tc in range(int(input())):
	n = int(input())
	l = list(ain())
	l.sort()
	l2 = []
	i = 0
	j = n - 1
	for _ in range(n // 2 + n % 2):
		l2.append(l[i])
		if i != j:
			l2.append(l[j])
		i += 1
		j -= 1
	l2 = l2[::-1]
	print(*l2)


t = int(input())
for i in range(t):
	n = int(input())
	ls = [int(a) for a in input().split()]
	ls.sort()
	ls1 = []
	for j in range(len(ls) // 2):
		ls1.append(ls[j])
		ls1.append(ls[len(ls) - j - 1])
	if len(ls) % 2 != 0:
		ls1.append(ls[len(ls) // 2])
	ls1.reverse()
	s = ''
	for a in ls1:
		print(a, end=' ')


from math import ceil
t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(map(int, input().split()))
	s = ceil(n / 2) - 1
	for (i, j) in zip(a[s::-1], a[s + 1::1]):
		print('%i\n%i' % (i, j))
	if n % 2 != 0:
		print(a[0])


for _ in range(int(input())):
	n = int(input())
	l = []
	c = -1
	a = sorted([int(x) for x in input().split()])
	for i in range(n):
		if i % 2 == 0:
			l += [a[i // 2]]
		else:
			l += [a[c]]
			c -= 1
	l.reverse()
	print(*l)


t = int(input())
for i in range(t):
	alen = int(input())
	arr = list(map(int, input().split(' ')))
	arr.sort()
	for i in range(alen // 2):
		if alen % 2 == 0:
			print(arr[alen // 2 - i - 1], arr[alen // 2 + i], end=' ')
		if not alen % 2 == 0:
			print(arr[alen // 2 - i], arr[alen // 2 + i + 1], end=' ')
	if alen % 2:
		print(arr[0], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	i = list((int(num) for num in input().strip().split()))[:n]
	i.sort()
	ans = []
	mid = (n - 1) // 2
	ans.append(i[mid])
	for j in range(1, mid + 1):
		ans.append(i[mid + j])
		ans.append(i[mid - j])
	if n % 2 == 0:
		ans.append(i[n - 1])
	for k in ans:
		print(k, ' ', end='')
	print(' ')


from copy import deepcopy
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = deepcopy(a)
	b.sort(reverse=True)
	a.sort()
	c = [0] * n
	if n % 2 == 0:
		i = n - 1
		j = 0
		while i >= 0:
			c[i] = a[j]
			c[i - 1] = b[j]
			i -= 2
			j += 1
	else:
		i = n - 1
		j = 0
		while i > 0:
			c[i] = a[j]
			c[i - 1] = b[j]
			i -= 2
			j += 1
		c[0] = a[j]
	print(*c)


for _ in range(int(input())):
	input()
	l = sorted([int(i) for i in input().split()])
	j = (len(l) - 1) // 2
	k = 1
	ans = [l[j]]
	for i in range(len(l) - 1):
		j += (-1) ** i * k
		ans.append(l[j])
		k += 1
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	l = 0
	r = n - 1
	ans = []
	while l <= r:
		ans.append(a[l])
		l += 1
		if l <= r:
			ans.append(a[r])
			r -= 1
	ans.reverse()
	for i in ans:
		print(i, end=' ')
	print('')


T = int(input())
for i in range(T):
	N = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	ans = []
	i = 0
	j = N - 1
	while len(ans) != N:
		if i == j:
			ans.append(lst[i])
			break
		ans.append(lst[i])
		ans.append(lst[j])
		i += 1
		j -= 1
	print(*ans[::-1])


for _ in ' ' * int(input()):
	a = int(input())
	b = sorted(map(int, input().split()))
	while a:
		print(b.pop(a // 2), end=' ')
		a -= 1


for u in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	i = 0
	ka = []
	j = n - 1
	if n % 2 == 0:
		while i < j:
			ka.append(l[i])
			ka.append(l[j])
			j = j - 1
			i = i + 1
	else:
		for i in range(n // 2):
			ka.append(l[i])
			ka.append(l[n - 1 - i])
		ka.append(l[n // 2])
	print(*ka[::-1])


t = int(input())
for z in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	j = n - 1
	x = n - 1
	b = a.copy()
	if n % 2 == 0:
		for i in range(n // 2):
			b[x] = a[i]
			x = x - 1
			b[x] = a[j]
			x = x - 1
			j = j - 1
		print(*b, sep=' ')
	else:
		b[0] = a[n // 2]
		for i in range(n // 2):
			b[x] = a[i]
			x = x - 1
			b[x] = a[j]
			x = x - 1
			j = j - 1
		print(*b, sep=' ')


def func(l, n):
	l.sort()
	lf = []
	for i in range(0, n):
		lf.append('*')
	if n % 2 == 0:
		d = n - 1
		e = 0
		i = n - 1
		j = n - 2
		while j >= 0:
			i1 = l[d]
			i2 = l[e]
			lf[i] = i1
			lf[j] = i2
			d -= 1
			e += 1
			i -= 2
			j -= 2
	else:
		lf[0] = l[n // 2]
		d = n - 1
		e = 0
		i = n - 1
		j = n - 2
		while j >= 1:
			i1 = l[d]
			i2 = l[e]
			lf[i] = i1
			lf[j] = i2
			d -= 1
			e += 1
			i -= 2
			j -= 2
	return lf
t = int(input())
for i in range(0, t):
	n = int(input())
	l = list(map(int, input().split()))
	lf = func(l, n)
	for i in lf:
		print(i, end=' ')
	print('')


t = int(input())
x = []
for i in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split(' '))))
	b = []
	k = 0
	j = (len(a) - 1) // 2
	while j >= 0 and j < len(a):
		b += [a[j]]
		k = -k - 1 if k > 0 else -k + 1
		j += k
	print(' '.join(map(str, b)))


for _ in range(int(input())):
	n = int(input())
	ar = [int(x) for x in input().split()]
	ar.sort()
	i = 0
	j = len(ar) - 1
	ans = []
	while i <= j:
		ans.append(str(ar[j]))
		if i == j:
			break
		ans.append(str(ar[i]))
		i += 1
		j -= 1
	ans = ans[::-1]
	print(' '.join(ans))


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	start = n // 2
	new = []
	if n & 1:
		new.append(a[n // 2])
		start = n // 2 + 1
	if n & 1:
		j = 2
	else:
		j = 1
	for i in range(start, n):
		new.append(a[i - j])
		new.append(a[i])
		j += 2
	print(*new)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	b = sorted(list(map(int, input().split())))
	i = 0
	j = n - 1
	d = []
	while i <= j:
		if i == j:
			d.append(b[i])
		else:
			d.append(b[j])
			d.append(b[i])
		i += 1
		j += -1
	d.reverse()
	print(*d)


import sys

def main():
	t = int(input())
	for _ in range(t):
		n = int(sys.stdin.readline().strip())
		nums = list(map(int, sys.stdin.readline().split()))
		nums.sort()
		ans = []
		leftFlag = None
		pos = None
		if n % 2:
			ans.append(nums[n // 2])
			pos = n // 2
			if abs(nums[n // 2] - nums[n // 2 + 1]) > abs(nums[n // 2] - nums[n // 2 - 1]):
				leftFlag = True
			else:
				leftFlag = False
		elif abs(nums[n // 2] - nums[n // 2 + 1]) > abs(nums[n // 2 - 1] - nums[n // 2 - 2]):
			ans.append(nums[n // 2 - 1])
			pos = n // 2 - 1
			leftFlag = False
		else:
			ans.append(nums[n // 2])
			pos = n // 2
			leftFlag = True
		cnt = 1
		while cnt < n:
			if leftFlag:
				ans.append(nums[pos - cnt])
				pos -= cnt
			else:
				ans.append(nums[pos + cnt])
				pos += cnt
			leftFlag = not leftFlag
			cnt += 1
		for i in ans:
			print(i, end=' ')
		print('')
	return
main()


import math
a = int(input())
for i in range(0, a):
	b = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = [0] * len(arr)
	j = 0
	l = 0
	right = len(arr) - 1
	while right >= l:
		if right == l:
			ans[len(arr) - j - 1] = arr[l]
		else:
			ans[len(arr) - j - 1] = arr[l]
			ans[len(arr) - j - 2] = arr[right]
		l = l + 1
		right = right - 1
		j = j + 2
	print(' '.join(list(map(str, ans))))


from collections import deque
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a = deque(sorted(a))
	side = 1
	b = []
	while a:
		if side == 1:
			b.append(a.pop())
		else:
			b.append(a.popleft())
		side *= -1
	print(' '.join(map(str, reversed(b))))


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split(' '))), reverse=True)
	b = []
	for i in range(n // 2):
		b.append(a[-i - 1])
		b.append(a[i])
	if n & 1:
		b.append(a[n // 2])
	print(*b[::-1])


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l = sorted(l1)
	l.reverse()
	a = []
	for i in range(0, n // 2):
		a += [l[i]]
		a += [l[n - 1 - i]]
	if n % 2 != 0:
		a += [l[n // 2]]
	for i in range(n - 1, -1, -1):
		print(a[i], end=' ')
	print()


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

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

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()
res = ['YES', 'NO']

def main():
	n = ii()
	a = li()
	a.sort()
	x = n // 2
	for i in range(x, x * 2):
		print(a[i], end=' ')
		print(a[2 * x - i - 1], end=' ')
	if n % 2:
		print(a[-1], end='')
	print()
	return ()
for _ in range(ii()):
	main()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	while a:
		ans.append(a.pop(len(a) // 2))
	print(*ans)


T = int(input())
results = []
for case in range(1, T + 1):
	n = int(input())
	arr = [int(i) for i in input().split()]
	arr = sorted(arr)
	middle = n // 2
	result = [arr[middle]]
	for i in range(1, middle + 1):
		num1 = arr[middle - i]
		result.append(num1)
		if middle + i <= n - 1:
			num2 = arr[middle + i]
			result.append(num2)
	results.append(result)
for result in results:
	print(' '.join([str(i) for i in result]))


t = int(input())
a = []
b = []
x = ''
for i in range(t):
	b.clear()
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	for j in range(n):
		l = len(a) // 2 - 1 + len(a) % 2
		b.append(a[l + (j // 2 + j % 2) * (-1) ** (j + 1)])
	for p in b:
		print(p, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		m = n // 2
		o = m - 1
		for i in range(n // 2):
			print(a[o], a[m], end=' ')
			o -= 1
			m += 1
	else:
		m = n // 2
		o = m - 1
		q = m + 1
		print(a[m], end=' ')
		for i in range(1, n // 2 + 1):
			print(a[o], a[q], end=' ')
			o -= 1
			q += 1


t = int(input())
result_total = []
while t:
	n = int(input())
	array1 = list(map(int, input().split()))
	array = sorted(array1)
	length = len(array)
	if not length % 2:
		result = []
		start_point = int(length / 2 - 1)
		end_point = int(length / 2)
		result.append(array[start_point])
		for k in range(end_point + 1):
			if k and k != end_point:
				result.append(array[start_point + k])
				result.append(array[start_point - k])
			elif k == end_point:
				result.append(array[start_point + k])
	else:
		result = []
		start_point = int(length // 2)
		result.append(array[start_point])
		for k in range(start_point + 1):
			if k:
				result.append(array[start_point + k])
				result.append(array[start_point - k])
	result_total.append(result)
	t -= 1
for mas in result_total:
	print(str(mas).replace('[', '').replace(']', '').replace(',', ''))


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def solve(n):
	return n * (n + 1) // 2
t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	i = 0
	j = n - 1
	while j >= i:
		if j != i:
			ans.append(l[j])
			ans.append(l[i])
		else:
			ans.append(l[i])
		j -= 1
		i += 1
	la = []
	ans.reverse()
	for i in range(len(ans) - 1):
		la.append(abs(ans[i] - ans[i + 1]))
	print(*ans)


T = int(input())
for i in range(T):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	ra = (n - 1) // 2
	l
	for i in range(ra + 1):
		ans.append(l[i])
		if n % 2:
			if i != ra:
				ans.append(l[n - 1 - i])
		else:
			ans.append(l[n - 1 - i])
	print(*ans[::-1])


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	(i, j) = (1, n - 2)
	ans = [a[0], a[n - 1]]
	while i < j:
		ans.append(a[i])
		ans.append(a[j])
		i = i + 1
		j = j - 1
	if i == j:
		ans.append(a[i])
	ans.reverse()
	for i in ans:
		s = ' '
		if i == ans[len(ans) - 1]:
			s = '\n'
		print(i, end=s)


for i in range(int(input())):
	k = int(input())
	a = list(map(int, input().split()))
	a.sort()
	i = 0
	j = len(a) - 1
	b = []
	while i < j:
		b.append(a[i])
		b.append(a[j])
		i += 1
		j -= 1
	if i == j:
		b.append(a[i])
	b = b[::-1]
	b = ' '.join((str(i) for i in b))
	print(b)


def cal(nums):
	nums.sort()
	l = 0
	r = len(nums) - 1
	tmp = []
	while l < r:
		tmp.append(nums[r])
		tmp.append(nums[l])
		l += 1
		r -= 1
	if l == r:
		tmp.append(nums[l])
	return tmp

def solve():
	t = int(input())
	for _ in range(t):
		input()
		nums = [int(i) for i in input().split()]
		print(' '.join([str(i) for i in cal(nums)[::-1]]))
solve()


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	r = []
	for i in range(n):
		if i % 2 == 0:
			r.append(a[-1 - i // 2])
		else:
			r.append(a[i // 2])
	r.reverse()
	print(*r)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		aa = [int(a) for a in input().split()]
		aa.sort()
		res = []
		for i in range(n // 2):
			res += [aa[i], aa[-i - 1]]
		if n % 2 == 1:
			res.append(aa[n // 2])
		print(' '.join(map(str, res[::-1])))
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
for h in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = 0
	r = n - 1
	ans = [0] * n
	for i in range(n - 1, -1, -1):
		if (i - (n - 1)) % 2 == 0:
			ans[i] = a[r]
			r -= 1
		else:
			ans[i] = a[l]
			l += 1
	print(*ans)


t = int(input())
for i in range(t):
	l = int(input())
	arr = sorted(list(map(int, input().split())))
	new_arr = arr.copy()
	where = -1
	for i in range(l):
		if where == -1:
			new_arr[-1 - i] = arr[int(l - 1 - i / 2)]
			where = 0
		else:
			new_arr[-1 - i] = arr[int((i - 1) / 2)]
			where = -1
	print(' '.join([str(el) for el in new_arr]))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	i = (n - 1) // 2 - 1
	print(l[i + 1], end=' ')
	if n & 1:
		j = i + 2
	else:
		print(l[i + 2], end=' ')
		j = i + 3
	while i > -1:
		print(l[i], l[j], end=' ')
		i -= 1
		j += 1
	print()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = []
	ll = 0
	r = n - 1
	f = True
	while ll <= r:
		if f:
			a.append(l[ll])
			ll += 1
		else:
			a.append(l[r])
			r -= 1
		if f == False:
			f = True
		else:
			f = False
	a = a[::-1]
	for j in range(len(a)):
		print(a[j], end=' ')
	print()


def main():
	num_testes = int(input())
	respostas = []
	for i in range(num_testes):
		n = int(input())
		lista = input().split()
		lista = [int(x) for x in lista]
		resposta = []
		lista.sort()
		l = int((n - 1) / 2)
		r = int((n + 1) / 2)
		while l >= 0 or r < n:
			if l >= 0:
				resposta.append(lista[l])
				l -= 1
			if r < n:
				resposta.append(lista[r])
				r += 1
		respostas.append(resposta)
	for i in range(num_testes):
		for j in range(len(respostas[i]) - 1):
			print(respostas[i][j], end=' ')
		print(respostas[i][-1])
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	dp = [0] * n
	i = 0
	j = n - 1
	t = n - 1
	while i <= j:
		if i != j:
			dp[t] = a[i]
			dp[t - 1] = a[j]
			i += 1
			j -= 1
			t -= 2
		else:
			dp[t] = a[i]
			break
	print(*dp)


def answer(arr, n):
	arr.sort()
	result = []
	if n % 2 == 1:
		result.append(arr[n // 2])
	for i in range(n // 2, 0, -1):
		leftIndex = i - 1
		rightIndex = n - leftIndex - 1
		result.append(arr[leftIndex])
		result.append(arr[rightIndex])
	return ' '.join([str(c) for c in result])
testCount = int(input())
for _ in range(testCount):
	n = int(input())
	arr = list(map(int, input().split()))
	print(answer(arr, n))


import sys
t = int(input())
inp = [line.strip().split() for line in reversed(sys.stdin.readlines())]
ans = []
while t:
	n = int(inp.pop()[0])
	a = sorted([int(i) for i in inp.pop()])
	lena = len(a)
	tans = []
	if lena % 2 == 1:
		mid = lena // 2
		tans.append(str(a[mid]))
		for i in range(1, lena // 2 + 1):
			tans.append(str(a[mid + i]))
			tans.append(str(a[mid - i]))
		ans.append(' '.join(tans))
	else:
		mid = lena // 2
		curup = mid
		curd = mid - 1
		tans.append(a[curd])
		tans.append(a[curup])
		for i in range(lena // 2 - 1):
			curd -= 1
			curup += 1
			tans.append(a[curd])
			tans.append(a[curup])
		ans.append(' '.join(map(str, tans)))
	t -= 1
print(*ans, sep='\n')


I = input
exec(int(I()) * 'I();nums=I().split()\nnums.sort(key=int)\nwhile nums: print(nums.pop(len(nums)//2))\n')


t = int(input())
while t != 0:
	n = int(input())
	A = list(map(int, input().split()))
	B = sorted(A)
	res1 = B[:int(n / 2)]
	res2 = B[int(n / 2):]
	res2.reverse()
	res = []
	i = 0
	while i < int(n / 2):
		res.append(res2[i])
		res.append(res1[i])
		i += 1
	if len(res1) == len(res2):
		res.reverse()
		print(*res)
	else:
		res.append(res2[-1])
		res.reverse()
		print(*res)
	t -= 1


import collections
t = int(input())
for _ in range(0, t):
	l = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = collections.deque()
	turns = [0, 1]
	j = 0
	lidx = len(arr) - 1
	sidx = 0
	while lidx >= sidx:
		j %= 2
		if turns[j] == 0:
			ans.appendleft(arr[sidx])
			sidx += 1
			j += 1
		else:
			ans.appendleft(arr[lidx])
			lidx -= 1
			j += 1
	print(' '.join(list(map(str, ans))))


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	if n % 2:
		x = n // 2
		le = x - 1
		ri = x + 1
		print(l[x], end=' ')
		for i in range(n - 1):
			if i % 2:
				print(l[ri], end=' ')
				ri += 1
			else:
				print(l[le], end=' ')
				le -= 1
	else:
		x = n // 2
		le = x - 1
		ri = x
		for i in range(n):
			if i % 2 == 0:
				print(l[le], end=' ')
				le -= 1
			else:
				print(l[ri], end=' ')
				ri += 1
	print()


for _ in range(int(input())):
	s = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = l[:len(l) // 2]
	l = l[len(l) // 2:]
	l = l[::-1]
	while len(l) > 0:
		print(l.pop(), end=' ')
		if len(a) > 0:
			print(a.pop(), end=' ')
	print()


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
from sys import stdin, stdout
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')
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ar.sort()
	l = 0
	r = n - 1
	flag = 'l'
	answer = []
	while l <= r:
		if flag == 'l':
			answer.append(ar[l])
			flag = 'r'
			l += 1
		else:
			answer.append(ar[r])
			flag = 'l'
			r -= 1
	answer.reverse()
	print(*answer, sep=' ')
sys.exit(0)

class Person:

	def __init__(self, name, age):
		self.name = name
		self.age = age
p1 = Person('heelo', 27)
print(help(Person))
age = 26
name = 'Swaroop'
print('Возрас {} -- {} лет'.format(name, age))
print(help(object))


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	b = []
	(i, j) = (0, n)
	while i < j:
		j -= 1
		b += (a[j],)
		if i < j:
			b += (a[i],)
			i += 1
	print(*b[::-1])


for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	list1.sort()
	list2 = []
	i = 0
	if n % 2 == 0:
		while i < n / 2:
			list2.append(list1[int(n / 2) - 1 - i])
			list2.append(list1[int(n / 2) + i])
			i += 1
	else:
		list2.append(list1[int(n / 2)])
		while i < n / 2 - 1:
			list2.append(list1[int(n / 2) - 1 - i])
			list2.append(list1[int(n / 2) + 1 + i])
			i += 1
	for i in list2:
		print(i, end=' ')


a = int(input())
for i in range(a):
	m = int(input())
	l = list(map(int, input().split()))
	l.sort()
	while l != []:
		print(l[len(l) // 2], end=' ')
		l.pop(len(l) // 2)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	j = n - 1
	i = 0
	a.sort()
	b = []
	while i <= j:
		if i != j:
			b.append(a[j])
			b.append(a[i])
		else:
			b.append(a[i])
		j -= 1
		i += 1
	print(*b[::-1])


t = int(input())
for o in range(t):
	n = int(input())
	c = list(map(int, input().split()))
	c.sort()
	g = []
	for i in range(n):
		if i % 2 == 0:
			g.append(c[i // 2])
		else:
			g.append(c[-i // 2])
	print(*g[::-1])


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	i = 0
	j = n - 1
	res = []
	while i < j:
		res.append(a[i])
		res.append(a[j])
		i += 1
		j -= 1
	if i == j:
		res.append(a[i])
	res.reverse()
	for x in res:
		print(x, end=' ')
	print('')


import sys
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	s.sort()
	ans = []
	for i in range(n // 2):
		ans.append(s[i])
		ans.append(s[-1 - i])
	if n % 2:
		ans.append(s[n // 2])
	print(' '.join(map(str, reversed(ans))))


t = int(input())
for case in range(t):
	n = int(input())
	numbers = [int(x) for x in input().split()]
	numbers.sort()
	p = n // 2
	answer = []
	for i in range(p):
		answer.append(numbers[p + i])
		answer.append(numbers[p - i - 1])
	if n % 2 == 1:
		answer.append(numbers[n - 1])
	print(*answer)


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	i = (n - 1) // 2
	j = i + 1
	while i >= 0 or j < n:
		if i >= 0:
			ans.append(a[i])
		if j < n:
			ans.append(a[j])
		i -= 1
		j += 1
	print(*ans)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	temp = []
	arr = list(map(int, input().split()))
	arr.sort()
	for i in range(0, n // 2):
		temp.append(arr[i])
		temp.append(arr[n - i - 1])
	if n % 2 != 0:
		temp.append(arr[n // 2])
	for i in range(n - 1, -1, -1):
		print(temp[i], end=' ')
	print('')


for _ in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	list1.sort()
	if n & 1 != 1:
		j = n // 2
		i = j - 1
		while i >= 0 and j <= n - 1:
			print(list1[i], list1[j], end=' ')
			i -= 1
			j += 1
		print()
	else:
		j = n // 2
		i = j - 1
		while i >= 0 and j <= n - 1:
			print(list1[j], list1[i], end=' ')
			i -= 1
			j += 1
		print(list1[-1])


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, A):
	A.sort()
	ans = []
	for i in range((N - 1) // 2, -1, -1):
		j = N - 1 - i
		ans.append(A[i])
		if i != j:
			ans.append(A[j])
	return ' '.join(map(str, ans))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, A)
	print(ans)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	midl = n // 2
	midl -= 1
	v = []
	midl2 = midl + 1
	v.append(a[midl2])
	v.append(a[midl])
	c = 1
	while len(v) != n:
		v.append(a[midl2 + c])
		if len(v) == n:
			break
		v.append(a[midl - c])
		if len(v) == n:
			break
		c += 1
	print(*v)


import sys
input = lambda : sys.stdin.readline().rstrip()
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	ans = []
	ans.append(a[0])
	ans.append(a[-1])
	del a[0]
	del a[-1]
	l = 0
	r = n - 3
	for i in range(n - 2):
		if abs(a[l] - ans[-1]) >= abs(ans[-1] - a[r]):
			ans.append(a[l])
			l += 1
		else:
			ans.append(a[r])
			r -= 1
	print(*ans[::-1])


t = int(input())
while t != 0:
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	if len(l) % 2 == 0:
		k = 0
		i = n // 2 - 1
		while i >= 0:
			print(l[i], end=' ')
			print(l[n // 2 + k], end=' ')
			k += 1
			i -= 1
	else:
		i = n // 2
		print(l[i], end=' ')
		i -= 1
		k = 0
		while i >= 0:
			print(l[i], end=' ')
			print(l[n // 2 + 1 + k], end=' ')
			k += 1
			i -= 1
	print('\n')
	t -= 1


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	res = []
	a.sort()
	idx = n // 2
	cnt = 0
	pos = True
	while cnt < n:
		if pos and idx + cnt < n:
			idx += cnt
		elif not pos and idx - cnt >= 0:
			idx -= cnt
		res.append(a[idx])
		cnt += 1
		pos = not pos
	print(*res)


T = int(input())
for i in range(T):
	res = []
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	(l, r, now) = (0, n - 1, 0)
	while l <= r:
		if now:
			res.append(a[r])
			r -= 1
		else:
			res.append(a[l])
			l += 1
		now = not now
	for x in range(n - 1, -1, -1):
		print(res[x])


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	res = []
	i = 0
	j = n - 1
	iNext = True
	while i <= j:
		if iNext:
			res.append(a[i])
			i += 1
		else:
			res.append(a[j])
			j -= 1
		iNext = not iNext
	res.reverse()
	print(' '.join([str(x) for x in res]))


t = int(input())
for test in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	new_a = []
	start = 0
	end = len(a) - 1
	while start <= end:
		if start == end:
			new_a.append(a[end])
			end -= 1
			start += 1
			continue
		new_a.append(a[end])
		end -= 1
		new_a.append(a[start])
		start += 1
	new_a.reverse()
	for i in range(len(new_a)):
		print(new_a[i], end=' ')
	print()


t = int(input())
for x in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	i = 0
	j = len(a) - 1
	k = j
	new = [0 for y in range(len(a))]
	while i < j:
		new[k] = a[j]
		new[k - 1] = a[i]
		i += 1
		j -= 1
		k -= 2
	if i == j:
		new[k] = a[i]
	print(*new)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(sorted(map(int, input().split())))
	result = []
	parity = True

	def parity_func(i):
		global parity, result
		if parity:
			result += [a[i], a[n - 1 - i]]
		else:
			result += [a[n - 1 - i], a[i]]
	for i in range(n // 2):
		parity_func(i)
	if n % 2 != 0:
		result += [a[n // 2]]
	print(*result[::-1])


from sys import stdin, stdout

def find(arr, N):
	res = []
	arr.sort()
	(i, j) = (0, N - 1)
	while i <= j:
		if i == j:
			res.append(arr[i])
		else:
			res.append(arr[i])
			res.append(arr[j])
		i += 1
		j -= 1
	res.reverse()
	return ' '.join(map(str, res))

def main():
	for _ in range(int(stdin.readline())):
		N = int(stdin.readline())
		arr = list(map(int, stdin.readline().split()))
		print(find(arr, N))
main()


def f(arr):
	arr = sorted(arr)
	new_arr = []
	while len(arr) > 1:
		l = arr.pop(0)
		r = arr.pop(-1)
		new_arr.extend([l, r])
	if arr:
		new_arr.append(arr[0])
	out = ''
	for a in new_arr[::-1]:
		out += '{} '.format(a)
	return out
T = int(input())
for i in range(T):
	n = int(input())
	arr = [int(a) for a in input().split(' ')]
	print(f(arr))


import sys
e = int(input())
for ee in range(e):
	n = int(input())
	a = [int(i) for i in input().split(' ', n - 1)]
	a.sort()
	i = n // 2
	j = 0
	g = 0
	while True:
		if i < 0 or i >= n:
			break
		print(a[i], end=' ')
		j += 1
		if g == 0:
			i -= j
			g = 1
		else:
			i += j
			g = 0
	print()


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	j = n - 1
	ls = [0] * n
	count = n - 1
	while j > i:
		ls[count] = arr[j]
		count -= 1
		ls[count] = arr[i]
		count -= 1
		i += 1
		j -= 1
	if len(arr) % 2 != 0:
		ls[0] = arr[n // 2]
	print(*ls)


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	mid = n // 2
	l = mid - 1
	r = mid + 1
	ans = [a[mid]]
	if n % 2 == 1:
		for i in range(mid):
			ans.append(a[l])
			ans.append(a[r])
			l -= 1
			r += 1
	else:
		for i in range(mid - 1):
			ans.append(a[l])
			ans.append(a[r])
			l -= 1
			r += 1
		ans.append(a[l])
	print(*ans)


from sys import stdin
inp = stdin.readline
t = int(inp().strip())
for _ in range(t):
	n = int(inp().strip())
	a = [int(x) for x in inp().strip().split()]
	a.sort(reverse=True)
	ans = []
	i = 0
	j = n - 1
	while True:
		ans.append(a[j])
		if i != j:
			ans.append(a[i])
		if len(ans) == n:
			break
		j -= 1
		i += 1
	print(*ans[::-1])


def sol():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	i = 0
	res = []
	pos = (n - 1) // 2
	while len(res) < n:
		if i % 2 == 0:
			pos = pos - i
		else:
			pos = pos + i
		res.append(str(a[pos]))
		i += 1
	return res
t = int(input())
for i in range(t):
	print(' '.join(sol()))


t = input()
t = int(t)
while t > 0:
	t -= 1
	n = input()
	n = int(n)
	arr = input().split(' ')
	arr = [int(val) for val in arr]
	arr = sorted(arr)
	if n % 2 == 0:
		i = n // 2 - 1
		j = i + 1
		while i >= 0 and j < n:
			print(arr[i], end=' ')
			print(arr[j], end=' ')
			i -= 1
			j += 1
	else:
		i = n // 2
		j = i
		while i >= 0 and j < n:
			if i == j:
				print(arr[i], end=' ')
			else:
				print(arr[i], end=' ')
				print(arr[j], end=' ')
			i -= 1
			j += 1
	print()


T = int(input())
for t in range(T):
	N = int(input())
	nums = [num for num in map(int, input().split())]
	nums.sort()
	ans = []
	(l, r) = (0, len(nums) - 1)
	for i in range(len(nums)):
		if i % 2 == 0:
			ans.append(nums[l])
			l += 1
		else:
			ans.append(nums[r])
			r -= 1
	for i in range(len(ans) - 1, -1, -1):
		print(ans[i], end=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = 0
	b = n - 1
	count = 0
	ans = []
	while True:
		if count == n:
			break
		ans.append(l[a])
		count += 1
		if count == n:
			break
		ans.append(l[b])
		a += 1
		b -= 1
	for i in range(n - 1, -1, -1):
		print(ans[i], end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	p = n // 2
	s = 1
	o = []
	for i in range(n):
		o.append(str(a[p]))
		if s & 1:
			p -= s
		else:
			p += s
		s += 1
	print(' '.join(o))


for _ in range(int(input())):
	n = int(input())
	aa = sorted(map(int, input().split()))
	n2 = n // 2
	isl = True
	ans = []
	d = -1
	i = n2
	for _ in range(n):
		ans.append(aa[i])
		i += d
		if isl:
			d = -d + 1
		else:
			d = -d - 1
		isl ^= True
	print(' '.join(map(str, ans)))


for nt in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	m = 10 ** 9
	ans = []
	i = 0
	j = n - 1
	while len(ans) != n:
		if i == j:
			ans.append(l[i])
			break
		ans.append(l[i])
		ans.append(l[j])
		i += 1
		j -= 1
	print(*ans[::-1])


q = int(input())
for _ in range(q):
	n = int(input())
	s = [int(i) for i in input().split()]
	s.sort()
	a = [0] * n
	if n % 2:
		a[0] = s[n // 2]
		for i in range(n // 2):
			(a[2 * i + 1], a[2 * i + 2]) = (s[n // 2 - i - 1], s[n // 2 + i + 1])
	else:
		for i in range(n // 2):
			(a[2 * i], a[2 * i + 1]) = (s[n // 2 - i - 1], s[n // 2 + i])
	for i in range(n):
		print(a[i], end=' ')
	print()


import sys
input = sys.stdin.buffer.readline

def array_to_string(a):
	s = ''
	for i in a:
		s += str(i)
	return s
t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	temp = []
	front = 0
	end = n - 1
	while front < end:
		temp.append(a[front])
		temp.append(a[end])
		front += 1
		end -= 1
	if n % 2 != 0:
		temp.append(a[front])
	temp = temp[::-1]
	for i in temp:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	if n % 2:
		(l, r) = (n // 2, n // 2)
	else:
		(l, r) = (n // 2 - 1, n // 2)
	ans = []
	while l >= 0 and r < n:
		if l != r:
			ans.append(arr[l])
			ans.append(arr[r])
		else:
			ans.append(arr[l])
		l -= 1
		r += 1
	print(*ans)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
from collections import *
ORDA = 97

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

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

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

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

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def function(arr, size, dp):
	if size == 1 or size == 0:
		return 1
	key = ''.join(map(str, arr[:size]))
	if dp[key]:
		return dp[key]
	output = function(arr, size - 1, dp)
	key = ''.join(map(str, arr[:size - 1]))
	dp[key] = output
	if arr[size - 2] * 10 + arr[size - 1] <= 26:
		output += function(arr, size - 2, dp)
		key = ''.join(map(str, arr[:size - 2]))
		dp[key] = output
	return output

def main():
	for _ in range(ii()):
		n = ii()
		arr = li()
		arr = sorted(arr)
		if n % 2 == 0:
			i = n // 2 - 1
			j = n // 2
			while i >= 0:
				print(arr[i], arr[j], end=' ')
				i -= 1
				j += 1
			print()
		else:
			i = n // 2
			j = i + 1
			while i >= 0 and j < n:
				print(arr[i], arr[j], end=' ')
				i -= 1
				j += 1
			print(arr[i])
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	if n % 2 != 0:
		p = int(len(a) / 2)
		b.append(a[p])
		r = p + 1
		l = p - 1
		while r < len(a):
			b.append(a[l])
			b.append(a[r])
			l -= 1
			r += 1
		print(' '.join([str(j) for j in b]))
	else:
		a0 = a[0]
		a = a[1:]
		p = int(len(a) / 2)
		b.append(a[p])
		r = p + 1
		l = p - 1
		while r < len(a):
			b.append(a[l])
			b.append(a[r])
			l -= 1
			r += 1
		b.append(a0)
		print(' '.join([str(j) for j in b]))


for _ in range(int(input())):
	N = int(input())
	L = list(map(int, input().split()))
	L.sort(reverse=True)
	X = []
	for i in range(N // 2):
		X.append(L[i])
		X.append(L[N - 1 - i])
	if N % 2 != 0:
		X.append(L[N // 2])
	X.reverse()
	print(*X)


from math import *
from bisect import bisect_left, bisect_right
from sys import stdin, stdout
from collections import Counter
input = lambda : stdin.readline().strip()
print = stdout.write
T = int(input())
for _ in range(T):
	n = int(input())
	ls = list(map(int, input().split()))
	ls.sort()
	ans = []
	for i in range(n):
		if not i % 2:
			ans.append(ls[-(i // 2) - 1])
		else:
			ans.append(ls[i // 2])
	ans.reverse()
	for i in ans:
		print(str(i) + ' ')
	print('\n')


import math

def ordf(a, n):
	a.sort()
	i = math.ceil(n / 2) - 1
	r = []
	x = 1
	flag = 1
	while i < n and i >= 0:
		r.append(a[i])
		i += x
		flag *= -1
		x = flag * (abs(x) + 1)
	print(*r)
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ordf(a, n)


import math
import sys
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

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

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
INF = 10 ** 18
MOD = 10 ** 9 + 7
from collections import deque
for _ in range(int(input())):
	N = int(input())
	A = alele()
	A.sort()
	if N <= 2:
		print(*A)
	else:
		x = (N - 1) // 2
		i = j = x
		Ans = [A[i]]
		j += 1
		i -= 1
		while i >= 0 and j <= N - 1:
			Ans.append(A[j])
			j += 1
			Ans.append(A[i])
			i -= 1
		if i == 0:
			Ans.append(A[i])
		if j == N - 1:
			Ans.append(A[j])
		print(*Ans)


for x in range(int(input())):
	n = int(input())
	m = list(map(int, input().split()))
	m.sort()
	a = []
	for i in range(n // 2):
		a.extend([m[i], m[n - i - 1]])
	if n % 2:
		a.append(m[n // 2])
	a = a[::-1]
	print(*a)


t = int(input())
for _ in range(t):
	valid = True
	n = int(input())
	ar = [int(x) for x in input().split()]
	ar = sorted(ar)
	res = []
	ar1 = ar[:n // 2]
	ar2 = ar[n // 2:][::-1]
	for (a, b) in zip(ar1, ar2):
		res.append(a)
		res.append(b)
	if len(ar2) > len(ar1):
		res.append(ar2[-1])
	for v in res[::-1]:
		print(v, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	x = [0] * n
	j = n - 1
	i = 0
	while i < n // 2 and j >= 0:
		x[j] = l[i]
		j -= 1
		x[j] = l[n - i - 1]
		j -= 1
		i += 1
	if n % 2 != 0:
		x[j] = l[i]
	for i in x:
		print(i, end=' ')
	print()


t = int(input())
for w in range(t):
	n = int(input())
	l = sorted([int(i) for i in input().split()])
	s = ''
	while n > 0:
		s += str(l.pop(n // 2)) + ' '
		n -= 1
	print(s)


t = int(input())
for i in range(0, t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ls = []
	if n % 2 == 0:
		la = a[0:n // 2]
		lb = a[n // 2:n]
		for j in range(0, n // 2):
			ls.append(la[n // 2 - j - 1])
			ls.append(lb[j])
	else:
		la = a[0:n // 2 + 1]
		lb = a[n // 2 + 1:n]
		for j in range(0, n // 2):
			ls.append(la[n // 2 - j])
			ls.append(lb[j])
		ls.append(la[0])
	print(*ls)


import sys
t = sys.stdin.buffer.readline()
for i in range(int(t)):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	i = 0
	j = n - 1
	ls = [0] * n
	count = n - 1
	while j > i:
		ls[count] = arr[j]
		count -= 1
		ls[count] = arr[i]
		count -= 1
		i += 1
		j -= 1
	if len(arr) % 2 != 0:
		ls[0] = arr[n // 2]
	print(*ls)


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	if n % 2 == 0:
		half = n // 2
		(left, right) = (half - 1, half)
		while left > -1 and right < n:
			print(l[left], l[right], end=' ')
			left -= 1
			right += 1
		print()
	else:
		half = n // 2
		(left, right) = (half - 1, half + 1)
		print(l[half], end=' ')
		while left > -1 and right < n:
			print(l[left], l[right], end=' ')
			left -= 1
			right += 1
		print()


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	a = list(map(int, sys.stdin.readline().split()))
	a.sort()
	right = n // 2
	left = n // 2 - 1
	for i in range(n):
		if i % 2 == 0:
			print(a[right], end=' ')
			right += 1
		else:
			print(a[left], end=' ')
			left -= 1
	print()


import sys
testcases = int(sys.stdin.readline())
for i in range(testcases):
	n = int(sys.stdin.readline())
	nums = sys.stdin.readline().split()
	for i in range(len(nums)):
		nums[i] = int(nums[i])
	new_list = []
	nums.sort()
	flag = False
	for index in range(int(n / 2)):
		if flag:
			flag = True
			new_list.append(int(nums[n - index - 1]))
			new_list.append(int(nums[index]))
		else:
			flag = False
			new_list.append(int(nums[index]))
			new_list.append(int(nums[n - index - 1]))
	if n % 2 == 1:
		new_list.append(int(nums[int(n / 2)]))
	new_list.reverse()
	for i in range(len(new_list)):
		new_list[i] = str(new_list[i])
	print(' '.join(new_list))


import sys
testcases = int(sys.stdin.readline())
for iteration in range(testcases):
	n = int(sys.stdin.readline())
	arr = list(map(int, sys.stdin.readline().split()))
	arr.sort()
	mid = (n + 1) // 2 - 1
	r = mid + 1
	l = mid - 1
	sys.stdout.write(str(arr[mid]) + ' ')
	flag = 0
	while r < n and l >= 0:
		if flag % 2 == 0:
			sys.stdout.write(str(arr[r]) + ' ')
			r += 1
		else:
			sys.stdout.write(str(arr[l]) + ' ')
			l -= 1
		flag += 1
	while r < n:
		sys.stdout.write(str(arr[r]) + ' ')
		r += 1
	while l >= 0:
		sys.stdout.write(str(arr[l]) + ' ')
		l -= 1
	sys.stdout.write('\n')


t = int(input())
for i in range(t):
	n = int(input())
	nums = sorted([int(a) for a in input().split()])
	s = 0
	e = len(nums) - 1
	answ = []
	for i in range(n):
		if i % 2 == 0:
			answ.append(nums[s])
			s += 1
		else:
			answ.append(nums[e])
			e -= 1
	for i in answ[::-1]:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = []
	if n % 2 == 0:
		(f, l) = (n // 2 - 1, n // 2)
		for i in range(n // 2):
			ans.append(a[f])
			ans.append(a[l])
			f -= 1
			l += 1
	else:
		f = l = n // 2
		ans.append(a[f])
		f -= 1
		l += 1
		for i in range(n // 2):
			ans.append(a[f])
			ans.append(a[l])
			f -= 1
			l += 1
	print(*ans)


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 300010
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	n = int(input())
	a = arrIN()
	a.sort()
	ans = []
	if n % 2:
		ans.append(a[n // 2])
	for i in range(n // 2 - 1, -1, -1):
		ans.extend([a[i], a[n - i - 1]])
	print(*ans)


def getIntsFromLine():
	return list(map(int, input().split()))
[T] = getIntsFromLine()
for case in range(T):
	[n] = getIntsFromLine()
	nums = sorted(getIntsFromLine())
	l = n // 2 - 1
	r = l + 1
	ans = []
	while l >= 0 and r < n:
		ans.append(nums[r])
		ans.append(nums[l])
		l -= 1
		r += 1
	if r == n - 1:
		ans.append(nums[r])
	print(' '.join([str(a) for a in ans]))


def ans(l):
	n = len(l)
	x = (n - 1) // 2
	y = x + 2
	for i in range(0, y - 1, 1):
		print(l[x - i], end=' ')
		if x + i + 1 < n:
			print(l[x + i + 1], end=' ')
	print()
t = int(input())
while t > 0:
	a = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans(l)
	t -= 1


import os
import sys
from io import BytesIO, IOBase

def solution(arr, n):
	arr.sort()
	res = []
	for i in range(n // 2):
		res.extend([arr[i], arr[n - i - 1]])
	if n & 1 == 1:
		res.append(arr[n // 2])
	write(*res[::-1])

def main():
	for _ in range(r_int()):
		n = r_int()
		arr = r_array()
		solution(arr, n)
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')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

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

def r_int():
	return int(input())
main()


t = int(input())
for _ in range(t):
	n = int(input())
	A = [int(j) for j in input().split()]
	A.sort()
	ans = []
	for i in range((n + 1) // 2):
		ans.append(A[i])
		if i < n - i - 1:
			ans.append(A[n - i - 1])
	print(*ans[::-1])


import sys
from collections import deque
T = int(sys.stdin.readline())
for _ in range(T):
	N = int(sys.stdin.readline())
	list_num = deque(sorted(list(map(int, sys.stdin.readline().split()))))
	result = []
	count = 0
	while list_num:
		if count % 2:
			result.append(list_num.pop())
		else:
			result.append(list_num.popleft())
		count += 1
	print(*reversed(result))


for t in range(0, int(input())):
	n = int(input())
	arr = list(input().split())
	arr = [int(x) for x in arr]
	arr = sorted(arr)
	solution = []
	if n % 2 == 1:
		solution.append(arr[n // 2])
		del arr[n // 2]
		n -= 1
	for i in range(n // 2 - 1, -1, -1):
		solution.append(arr[i])
		solution.append(arr[n - i - 1])
	print(*solution)


import sys
import math

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

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

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

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
INF = 10 ** 18
MOD = 10 ** 9 + 7
from collections import deque
for _ in range(int(input())):
	N = int(input())
	A = alele()
	A.sort()
	if N <= 2:
		print(*A)
	else:
		x = (N - 1) // 2
		i = j = x
		Ans = [A[i]]
		j += 1
		i -= 1
		while i >= 0 and j <= N - 1:
			Ans.append(A[j])
			j += 1
			Ans.append(A[i])
			i -= 1
		if i == 0:
			Ans.append(A[i])
		if j == N - 1:
			Ans.append(A[j])
		print(*Ans)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	given = list(map(int, input().split()))
	given.sort()
	answer = []
	if n % 2:
		answer.append(given.pop(n // 2))
		n -= 1
	for i in range(n // 2):
		answer.append(given[n // 2 - 1 - i])
		answer.append(given[n // 2 + i])
	print(*answer)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().strip().split()))
	a.sort()
	if n % 2 != 0:
		a1 = a[:n // 2 + 1]
		a2 = a[n // 2 + 1:]
		for i in range(n // 2):
			print(a1[-i - 1], end=' ')
			print(a2[i], end=' ')
		print(a1[0], end=' ')
	else:
		a1 = a[:n // 2]
		a2 = a[n // 2:]
		for i in range(n // 2):
			print(a1[-i - 1], end=' ')
			print(a2[i], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	midi = False
	if n % 2 == 1:
		midi = True
		mid = l[n // 2]
		l = l[:n // 2] + l[n // 2 + 1:]
		n = n - 1
	a = []
	for i in range(n // 2):
		a.append(l[i])
		a.append(l[n - i - 1])
	if midi:
		f = False
		if abs(a[0] - mid) >= abs(a[1] - a[0]):
			a = [mid] + a
		elif abs(a[-1] - a[-2]) >= abs(a[-1] - mid):
			a = a + [mid]
		else:
			for i in range(n - 1):
				if abs(a[i] - mid) >= abs(a[i + 1] - mid):
					a = a[:i + 1] + [mid] + a[i + 1:]
					f = True
					break
	a = a[::-1]
	print(*a)


test = int(input())
for t in range(test):
	N = int(input())
	list = [int(x) for x in input().split()]
	list.sort()
	n = len(list)
	while n:
		print(list.pop(n // 2), end=' ')
		n -= 1


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	m = n // 2
	le = m
	re = m
	i = 0
	ans = []
	ans.append(l[m])
	while True:
		if i % 2 == 0 and le - 1 >= 0:
			le = le - 1
			ans.append(l[le])
		elif i % 2 == 1 and re + 1 <= n - 1:
			re = re + 1
			ans.append(l[re])
		else:
			break
		i = i + 1
	for i in range(n):
		print(ans[i], end=' ')
	print()


import sys

def main():
	t = int(sys.stdin.readline())
	for l in range(t):
		n = int(sys.stdin.readline())
		valeurs = sys.stdin.readline().split()
		donnees = [0] * n
		for k in range(n):
			donnees[k] = int(valeurs[k])
		donnees.sort()
		ind = n // 2
		compte = -1
		for j in range(n):
			print(donnees[ind], end=' ')
			ind = ind + compte
			if compte < 0:
				compte = -compte + 1
			else:
				compte = -compte - 1
		print()
main()


for _ in range(int(input())):
	total_numbers = int(input())
	numbers = list(map(int, input().split()))
	numbers.sort()
	final = []
	for i in range(total_numbers // 2):
		final.append(numbers[i])
		position = -1 * (i + 1)
		final.append(numbers[position])
	if total_numbers % 2 == 1:
		middle = total_numbers // 2
		final.append(numbers[middle])
	final.reverse()
	print(' '.join(map(str, final)))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	arr = sorted(list(map(int, sys.stdin.readline().split())))
	answer = []
	mid = len(arr) // 2
	if len(arr) % 2 == 0:
		k = mid - 1
		a = mid
		answer.append(arr[k])
		answer.append(arr[a])
		for i in range(0, mid - 1):
			k -= 1
			a += 1
			answer.append(arr[k])
			answer.append(arr[a])
	else:
		k = mid - 1
		a = mid
		answer.append(arr[a])
		answer.append(arr[k])
		for i in range(0, mid - 1):
			k -= 1
			a += 1
			answer.append(arr[a])
			answer.append(arr[k])
		answer.append(arr[len(arr) - 1])
	print(' '.join(map(str, answer)))


for _ in range(int(input())):
	num = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	mid = num // 2
	if num % 2 == 0:
		ans = []
		i = mid - 1
		j = mid + 1
		ans.append(arr[mid])
		while 1:
			ans.append(arr[i])
			ans.append(arr[j])
			i -= 1
			j += 1
			if i == 0 and j == num:
				ans.append(arr[i])
				break
		print(*ans)
	else:
		ans = []
		i = mid - 1
		j = mid + 1
		ans.append(arr[mid])
		while 1:
			ans.append(arr[i])
			ans.append(arr[j])
			i -= 1
			j += 1
			if i == 0 and j == num - 1:
				ans.append(arr[i])
				ans.append(arr[j])
				break
			elif i < 0 and j > num - 1:
				break
		print(*ans)


T = int(input())
for i in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	c = N // 2
	(l, r) = (c - 1, c + 1)
	B = [A[c]]
	for i in range(c - 1):
		B += [A[l], A[r]]
		(l, r) = (l - 1, r + 1)
	B.append(A[0])
	if N % 2 == 1:
		B.append(A[N - 1])
	print(*B)


def sortedAdjacentDifferences(arr, n):
	ans = [0] * n
	arr = sorted(arr)
	r = n - 1
	l = 0
	for i in range(n - 1, -1, -1):
		if i % 2 == 0:
			ans[i] = arr[l]
			l += 1
		else:
			ans[i] = arr[r]
			r -= 1
	for i in range(n):
		print(ans[i], end=' ')
	print('')
t = int(input())
for tt in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	sortedAdjacentDifferences(arr, n)


def super_fun(new_arr):
	new_arr_1.sort()
	medium_el = (len(new_arr_1) - 1) // 2
	final_array = []
	count_el = medium_el
	flag = 1
	for i in range(1, len(new_arr_1) + 1):
		final_array.append(new_arr_1[count_el])
		if flag == 1:
			count_el += i
		else:
			count_el -= i
		flag *= -1
	return final_array
counts_of_array = int(input())
arrays = []
for i in range(0, counts_of_array):
	count_of_elements = input()
	arr = input()
	new_arr_1 = [int(x) for x in arr.split()]
	ans = super_fun(new_arr_1)
	for x in ans:
		print(x, end=' ')
	print('\n')


for item in [0] * int(input()):
	x = int(input())
	a = sorted([int(ele) for ele in input().split()])
	while x != 0:
		print(a.pop(x // 2), end=' ')
		x = x - 1


t = int(input())
for i in range(t):
	l = []
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	for k in range(0, int(len(a) / 2)):
		l.append(a[int(len(a) / 2) + k])
		l.append(a[int(len(a) / 2) - 1 - k])
	if len(a) % 2 != 0:
		l.append(a[len(a) - 1])
	c = ''
	for k in l:
		c += str(k) + ' '
	print(c[:len(c) - 1])


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	c = []
	if n % 2 == 0:
		for j in range(int(n / 2)):
			c.append(a[n - j - 1])
			c.append(a[j])
	else:
		val = int(n / 2) + 1
		for j in range(val):
			if j != val - 1:
				c.append(a[n - j - 1])
				c.append(a[j])
			else:
				c.append(a[j])
	string = ''
	for j in range(len(c)):
		if j != len(c) - 1:
			string += str(c[len(c) - j - 1])
			string += ' '
		else:
			string += str(c[len(c) - j - 1])
	print(string)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	m = (n + 1) // 2 - 1
	for (x, y) in zip(a[m::-1], a[m + 1:]):
		print(x, y, end=' ')
	if n % 2:
		print(a[0], end=' ')
	print()


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = []
	for i in range(n // 2):
		b.append(a[i])
		b.append(a[-i - 1])
	if n % 2:
		b.append(a[n // 2])
	b.reverse()
	print(' '.join([str(x) for x in b]))


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	while a:
		print(a.pop(len(a) // 2), end=' ')


def sorted_adj(n, array):
	array.sort()
	m = (n - 1) // 2
	array_n = [array[m]]
	i = -0
	while len(array_n) != n:
		i += 1
		array_n.append(array[m + i])
		if m - i >= 0:
			array_n.append(array[m - i])
	for x in array_n:
		print(x, end=' ')
	print()
t = int(input())
array = []
for i in range(t):
	a = int(input())
	b = list(map(int, input().split(' ')))
	array.append([a, b])
for x in array:
	sorted_adj(*x)


t = int(input())
for _ in range(t):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	k = []
	if n & 1:
		p = int(n / 2)
		f = []
		s = []
		for i in range(p + 1, n):
			s.append(i)
		for i in range(p - 1, -1, -1):
			f.append(i)
		print(l[p], end=' ')
		for i in range(p):
			print(l[s[i]], end=' ')
			print(l[f[i]], end=' ')
	else:
		p = int(n / 2)
		f = []
		s = []
		for i in range(p + 1, n + 1):
			s.append(i)
		for i in range(p - 1, 0, -1):
			f.append(i)
		print(l[p - 1], end=' ')
		for i in range(p - 1):
			print(l[s[i] - 1], end=' ')
			print(l[f[i] - 1], end=' ')
		print(l[n - 1], end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	a = input().split()
	for i in range(n):
		a[i] = int(a[i])
	a.sort()
	res = []
	for i in range(n // 2):
		res.append(a[i])
		res.append(a[n - i - 1])
	if n % 2 == 1:
		res.append(a[n // 2])
	res.reverse()
	for val in res:
		print(val, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	start = 0
	end = len(arr) - 1
	result = []
	while start <= end:
		result.append(arr[start])
		if start != end:
			result.append(arr[end])
		start += 1
		end -= 1
	for i in reversed(result):
		print(i, end=' ')
	print()


t = int(input())
while t:
	t = t - 1
	n = int(input())
	arr = list()
	arr2 = list()
	k = input().split()
	for i in k:
		arr.append(int(i))
	arr.sort()
	m = int(n / 2)
	arr2.append(arr[m])
	for i in range(1, m):
		arr2.append(arr[m - i])
		arr2.append(arr[m + i])
	arr2.append(arr[0])
	if 2 * m < n:
		arr2.append(arr[n - 1])
	for i in range(0, n):
		print(arr2[i], end=' ')
	print('\n')


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	res = []
	i = 0
	j = n - 1
	while i <= j:
		if i == j:
			res.append(l[i])
		else:
			res.append(l[i])
			res.append(l[j])
		i = i + 1
		j = j - 1
	for i in range(len(res) - 1, -1, -1):
		print(res[i], end=' ')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	taken = []
	mid = n // 2
	l = mid - 1
	r = mid
	if n % 2 != 0:
		taken.append(a[n // 2])
		r = mid + 1
	while l >= 0 and r < n:
		taken.append(a[l])
		taken.append(a[r])
		l -= 1
		r += 1
	for k in taken:
		print(k, end=' ')
	print('')


T = int(input())
for _ in range(T):
	n = int(input())
	arr = sorted([int(a) for a in input().strip().split()])
	(left_ind, right_ind) = (1, len(arr) - 2)
	(solution, moment_number) = ([str(arr[0]), str(arr[-1])], arr[-1])
	while left_ind != right_ind:
		(m1, m2) = (abs(arr[left_ind] - moment_number), abs(arr[right_ind] - moment_number))
		if m1 >= m2:
			moment_number = arr[left_ind]
			solution.append(str(moment_number))
			left_ind += 1
		else:
			moment_number = arr[right_ind]
			solution.append(str(moment_number))
			right_ind -= 1
	solution.append(str(arr[right_ind]))
	print(' '.join(reversed(solution)))


import math

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = [int(i) for i in input().split()]
		arr.sort()
		border = n // 2
		answer = []
		for i in range(0, border):
			answer.append(arr[-i - 1])
			answer.append(arr[i])
		if n % 2 == 1:
			answer.append(arr[border])
		answer.reverse()
		print(*answer)
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	p1 = n - 1
	p2 = 0
	flag = False
	while len(ans) != n:
		if flag:
			ans.append(l[p1])
			p1 -= 1
			flag = False
		else:
			ans.append(l[p2])
			p2 += 1
			flag = True
	ans = ans[::-1]
	print(' '.join(map(str, ans)))


def solve():
	n = int(input())
	arr = [int(v) for v in input().split()]
	arr.sort()
	buff = []
	l = 0
	r = n - 1
	while l < r:
		buff.append(arr[l])
		buff.append(arr[r])
		l += 1
		r -= 1
	if n % 2 > 0:
		buff.append(arr[l])
	buff = buff[::-1]
	print(' '.join([str(v) for v in buff]))
t = int(input())
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	a = input()
	listi = list(map(int, a.split()))
	listi.sort()
	cop = []
	left = 0
	right = n - 1
	cnt = 1
	ans = []
	while left <= right:
		if cnt % 2 == 0:
			cop.append(listi[left])
			left += 1
		else:
			cop.append(listi[right])
			right -= 1
		cnt += 1
	cop.reverse()
	ans.append(cop)
	for element in ans:
		print(*element, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	t = []
	if n & 1 == 0:
		for i in range(n // 2 - 1, -1, -1):
			t.append(l[i])
			t.append(l[n - i - 1])
		print(*t)
	else:
		t.append(l[n // 2])
		for i in range(n // 2 - 1, -1, -1):
			t.append(l[i])
			t.append(l[n - i - 1])
		print(*t)


def solution():
	t = int(input())
	for _ in range(t):
		n = int(input())
		nums = list(map(int, input().split()))
		nums.sort()
		if n % 2 == 0:
			j = n // 2
			i = j - 1
			print(nums[i], end=' ')
			print(nums[j], end='')
			i -= 1
			j += 1
		else:
			i = n // 2
			print(nums[i], end='')
			j = i + 1
			i -= 1
		while i >= 0:
			print(' ' + str(nums[i]), end='')
			print(' ' + str(nums[j]), end='')
			i -= 1
			j += 1
		print()
solution()


t = int(input())
for y in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	ans = [0 for i in range(n)]
	ind = 0
	for i in range((n + 1) // 2 - 1, -1, -1):
		ans[ind] = a[i]
		ind += 2
	ind = 1
	for i in range((n + 1) // 2, n):
		if ind >= n:
			break
		ans[ind] = a[i]
		ind += 2
	for i in ans:
		print(i, end=' ')
	print()


import sys, bisect
from math import gcd
input = sys.stdin.readline

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

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

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
t = inp()
for _ in range(t):
	n = inp()
	nums = inlt()
	nums.sort()
	ans = [0 for i in range(n)]
	left = 0
	right = n - 1
	index = n - 1
	while left <= right:
		ans[index] = nums[left]
		index -= 1
		left += 1
		if index < 0 or left > right:
			break
		ans[index] = nums[right]
		index -= 1
		right -= 1
		if index < 0 or left > right:
			break
	print(*ans)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = ip()
for _ in range(t):
	n = ip()
	arr = sorted(list(inp()))
	ans = []
	if n & 1 == 1:
		mid = n // 2
		ans = [arr[mid]]
		for i in range(1, mid + 1):
			ans.append(arr[mid + i])
			ans.append(arr[mid - i])
	else:
		st = n // 2 - 1
		end = n // 2
		while st != -1:
			ans.append(arr[st])
			ans.append(arr[end])
			st -= 1
			end += 1
	print(*ans)


from math import *
t = int(input())
m = []
n = []
for i in range(t):
	n.append(int(input()))
	x = list(map(int, input().split()))
	x.sort()
	m.append(x)
for i in range(t):
	k = floor(n[i] / 2)
	for j in range(n[i]):
		k = k + (-1) ** j * j
		print(m[i][k], end=' ')
	print(' ')


import math
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	l = [0] * n
	i = n - 1
	j = n - 1
	while i >= n // 2:
		l[j] = a[i]
		l[j - 1] = a[n - 1 - i]
		i = i - 1
		j = j - 2
	if n & 1:
		l[-1] = a[-1]
	print(*l)


T = int(input())
for i in range(0, T):
	N = int(input())
	A = [int(i) for i in input().split()]
	A.sort()
	while A != []:
		print(A[len(A) // 2], end=' ')
		A.pop(len(A) // 2)


for _ in range(int(input())):
	n = int(input())
	a = sorted(map(int, input().split()))
	(l, r, res) = (n // 2 - 1, n // 2, [])
	if n & 1:
		res.append(a[r])
		r += 1
	while l >= 0 and r < n:
		res.append(a[l])
		res.append(a[r])
		(l, r) = (l - 1, r + 1)
	print(*res)


def sorter(n, lst):
	(i, j, b) = (0, n - 1, list())
	while i < j:
		b.append(lst[i])
		b.append(lst[j])
		i += 1
		j -= 1
	if i == j:
		b.append(lst[i])
	return ' '.join((str(i) for i in b[::-1]))
for _ in range(int(input())):
	m = int(input())
	a = [int(i) for i in input().split()]
	print(sorter(m, sorted(a)))


def run(n, list_elements):
	newList = []
	list_elements.sort()
	medInd = len(list_elements) // 2
	printCount = 1
	totalCount = len(list_elements)
	print(list_elements[medInd], end=' ')
	printSpace = True
	desloc = 1
	while totalCount != printCount:
		if medInd - desloc >= 0:
			print(list_elements[medInd - desloc], end='')
			printCount += 1
			if totalCount != printCount:
				print(' ', end='')
		if medInd + desloc < len(list_elements):
			print(list_elements[medInd + desloc], end='')
			printCount += 1
			if totalCount != printCount:
				print(' ', end='')
		desloc += 1
	print('')
	return
i = int(input())
for _ in range(i):
	n = int(input())
	lst = list(map(int, input().split()))
	run(n, lst)


t = int(input())
for T in range(0, t):
	n = int(input())
	A = []
	A = [int(A) for A in input().split()]
	A.sort()
	if n % 2 == 0:
		i = n // 2 - 1
		count = 1
		while i != -1:
			print(A[i], end=' ')
			if count % 2 == 1:
				i += count
			else:
				i -= count
			count += 1
	if n % 2 == 1:
		i = (n + 1) // 2 - 1
		count = 1
		while i != -1:
			print(A[i], end=' ')
			if count % 2 == 1:
				i -= count
			else:
				i += count
			count += 1


t = int(input())
while t > 0:
	n = int(input())
	l = []
	l = list(map(int, input().split()))
	l.sort()
	g = []
	j = n
	i = (n + 1) // 2 - 1
	for j in range(n):
		g.append(l[i])
		if j % 2 == 0:
			i = i + j + 1
		else:
			i = i - j - 1
	print(*g, sep=' ')
	t = t - 1


def main_function():
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = sorted(list(map(int, input().split())))
		ans = []
		for i in range(n // 2):
			if n % 2 == 1:
				ans.append(a[n // 2 - i])
				ans.append(a[n // 2 + i + 1])
			else:
				ans.append(a[n // 2 - i - 1])
				ans.append(a[n // 2 + i])
		if n % 2 == 1:
			ans.append(a[0])
		print(*ans)
main_function()


t = int(input())
for i in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	arr.sort()
	ans = [None] * n
	for i in range(len(ans) // 2):
		ans[2 * i] = arr[i]
		ans[2 * i + 1] = arr[n - i - 1]
	if n % 2 == 1:
		ans[-1] = arr[n // 2]
	print(*ans[::-1])


for i in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	x = int((n - 1) / 2)
	y = x + 1
	b = True
	while n > 0:
		n -= 1
		if b:
			b = False
			print(a[x], end=' ')
			x -= 1
		else:
			b = True
			print(a[y], end=' ')
			y += 1
	print('')


test = int(input())
for i in range(0, test):
	num = input()
	list = [int(j) for j in input().split()]
	result = []
	list.sort()
	a = 0
	b = len(list) - 1
	while 0 <= b - a:
		result.append(list[b])
		if a != b:
			result.append(list[a])
		b = b - 1
		a = a + 1
	print(*reversed(result), sep=' ')


t = int(input())
res = []
for T in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	j = 1
	if n % 2 == 0:
		i = n // 2
		pre_res = [a[i]]
		while j < i:
			pre_res.append(a[i - j])
			pre_res.append(a[i + j])
			j += 1
		pre_res.append(a[0])
	else:
		i = n // 2
		pre_res = [a[i]]
		while j < i + 1:
			pre_res.append(a[i - j])
			pre_res.append(a[i + j])
			j += 1
	res.append(pre_res)
for i in res:
	for j in i:
		print(j, end=' ')
	print()


def solve():
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	i = 0
	j = n - 1
	ans = [None] * n
	if n % 2 == 0:
		while i < j:
			ans[j - i] = l[j]
			ans[j - i - 1] = l[i]
			i += 1
			j -= 1
	else:
		ans[0] = l[n // 2]
		while i < j:
			ans[j - i] = l[j]
			ans[j - i - 1] = l[i]
			i += 1
			j -= 1
	print(*ans)
try:
	for _ in range(int(input())):
		solve()
except:
	pass


from sys import stdin, stdout
t = int(stdin.readline().rstrip())
while t > 0:
	t -= 1
	tt = int(stdin.readline().rstrip())
	arr = map(int, stdin.readline().rstrip().split())
	arr = sorted(arr)
	er = []
	i = 0
	j = tt - 1
	while j >= i:
		if i == j:
			er.append(arr[i])
			break
		elif j < i:
			break
		else:
			er.append(arr[j])
			er.append(arr[i])
		j -= 1
		i += 1
	for x in reversed(range(tt)):
		(print(er[x]),)


a = int(input())
for _ in range(a):
	b = int(input())
	c = [int(i) for i in input().split()]
	c.sort()
	d = (-1 + b) // 2
	l = d - 1
	r = d + 1
	ans = [str(c[d])]
	while True:
		if r < b:
			ans.append(str(c[r]))
		if l >= 0:
			ans.append(str(c[l]))
		r += 1
		l -= 1
		if r >= b and l < 0:
			break
	print(' '.join(ans))


for h in range(int(input())):
	n = int(input())
	arr = list(map(int, input().strip().split()))
	arr.sort()
	ans = []
	for i in range(n):
		if n - 1 - i > i:
			ans.append(arr[n - 1 - i])
			ans.append(arr[i])
		if n - 1 - i == i:
			ans.append(arr[i])
	print(*ans[::-1])


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	be = 0
	en = n - 1
	while be < en:
		ans.append(l[be])
		ans.append(l[en])
		be += 1
		en -= 1
	if be == en:
		ans.append(l[be])
	ans.reverse()
	for j in ans:
		print(j, end=' ')
	print()


def solve():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		a = sorted(a)
		a_len = len(a)
		res = []
		(left_ptr, right_ptr) = (0, a_len - 1)
		if a_len % 2 == 1:
			left_ptr = right_ptr = a_len // 2
			res.append(a[left_ptr])
			left_ptr -= 1
			right_ptr += 1
		else:
			left_ptr = a_len // 2 - 1
			right_ptr = a_len // 2
		while left_ptr >= 0 and right_ptr < a_len:
			if a_len % 2 == 1:
				res.append(a[right_ptr])
				res.append(a[left_ptr])
			else:
				res.append(a[left_ptr])
				res.append(a[right_ptr])
			left_ptr -= 1
			right_ptr += 1
		print(*res)
solve()


t = int(input())
for _ in range(t):
	input()
	arr = sorted(map(int, input().split()))
	l = len(arr)
	mid = l // 2
	result = []
	for i in range(mid):
		if i == 0:
			result.append(arr[mid])
		else:
			result.append(arr[mid - i])
			result.append(arr[mid + i])
	i += 1
	if 0 <= mid - i:
		result.append(arr[mid - i])
	if mid + i < l:
		result.append(arr[mid + i])
	print(' '.join(map(str, result)))


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	i = n // 2 + n % 2
	j = i + 1
	p = []
	for k in range(n // 2 + n % 2):
		p.append(i)
		p.append(j)
		i -= 1
		j += 1
	if n % 2:
		p.pop()
	print(' '.join((str(a[i - 1]) for i in p)))


for tc in range(int(input())):
	n = int(input())
	A = input().split(' ')
	for i in range(n):
		A[i] = int(A[i])
	A.sort()
	if n % 2 == 1:
		k = int(n / 2)
		print(A[k], end=' ')
		for i in range(1, k + 1):
			print(A[k - i], A[k + i], end=' ')
		print()
	else:
		k = int(n / 2)
		print(A[k], end=' ')
		for i in range(1, k):
			print(A[k - i], A[k + i], end=' ')
		print(A[0])


n = int(input())
for i in range(n):
	k = int(input())
	l = sorted(list(map(int, input().split())))
	res = []
	it = int(k / 2)
	jump = 0
	sgn = -1
	diff = []
	last = -1
	for j in range(k):
		res.append(l[it])
		diff.append(abs(l[it] - last))
		last = l[it]
		jump = sgn * (abs(jump) + 1)
		sgn *= -1
		it += jump
	print(' '.join(map(str, res)))


def cast(cre, typ):
	return type(typ)(map(cre, typ))

def solution():
	for t in range(int(input())):
		n = int(input())
		l = sorted(cast(int, input().split()))
		res = list()
		lt = len(l)
		res.append(l[lt // 2])
		for i in range(lt - 1):
			a = i // 2 + 1
			if i % 2 == 0:
				a *= -1
			res.append(l[lt // 2 + a])
		print(' '.join(cast(str, res)))
solution()


from math import ceil, sqrt, log, gcd

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

def si():
	return input()

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

def li():
	return list(mi())
dx = [-1, -1, 1, 1, 0, 0, -1, 1]
dy = [0, -1, 1, 0, -1, 1, 1, -1]
vis = [[0 for i in range(1001)] for j in range(1001)]

def main():
	for _ in range(ii()):
		n = ii()
		b = li()
		ans = []
		b.sort()
		c1 = 0
		c2 = n - 1
		if n & 1:
			ans.append(b[c2])
			c2 -= 1
		for i in range(n // 2):
			ans.append(b[c1])
			ans.append(b[c2])
			c1 += 1
			c2 -= 1
		ans.reverse()
		print(*ans)
main()


for t in range(int(input())):
	n = int(input())
	A = [int(s) for s in input().split()]
	A.sort()
	ans = [0] * n
	half = n // 2
	for i in range(half):
		ans[2 * i] = A[i]
		ans[2 * i + 1] = A[n - 1 - i]
	if n % 2:
		ans[-1] = A[n // 2]
	print(' '.join((str(num) for num in ans[::-1])))


def out(l, leng):
	(counter, mid) = (0, leng // 2 - 1)
	i = 0
	while counter <= mid:
		counter += 1
		print(l[mid - i], l[mid + i + 1], end=' ')
		i += 1
for i in range(int(input())):
	_ = input()
	l = list(map(int, input().split()))
	l.sort()
	length = len(l)
	if length % 2 != 0:
		l.append(' ')
		length += 1
	out(l, length)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	b = []
	j = (len(a) - 1) // 2
	for i in range(n):
		if i % 2 == 0:
			j -= i
		else:
			j += i
		b.append(a[j])
	print(' '.join([str(i) for i in b]))


t = int(input())
for i in range(t):
	n = int(input())
	ls = list(map(int, input().split()))
	ls.sort()
	s = []
	if n % 2 == 0:
		j = int(n / 2)
		i = j - 1
	else:
		m = int(n / 2)
		s.append(ls[m])
		i = m - 1
		j = m + 1
	while 1:
		if i < 0 and j > n - 1:
			break
		else:
			s.append(ls[i])
			i = i - 1
			if j == n - 1:
				s.append(ls[j])
			else:
				s.append(ls[j])
			j = j + 1
	print(*s)


q = int(input())
for _ in range(q):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	f = []
	s = []
	for k in range(n):
		if k < n // 2:
			f.append(a[k])
		else:
			s.append(a[k])
	ans = []
	f = f[::-1]
	for k in range(n):
		if k % 2 == 0:
			ans.append(s[k // 2])
		else:
			ans.append(f[k // 2])
	print(*ans)


import random
for i in range(int(input())):
	s = int(input())
	n = sorted([int(i) for i in input().split()])
	ans = []
	i = 0
	x = 0
	y = 0
	for i in range(s):
		if i % 2 == 0:
			ans.append(n[-x - 1])
			x += 1
		if i % 2 == 1:
			ans.append(n[y])
			y += 1
	print(*ans[::-1])


for _ in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	l.sort()
	if len(l) % 2 == 0:
		x = n // 2 - 1
	else:
		x = n // 2
	ans = [l[x]]
	c = 0
	while len(ans) != n:
		if len(ans) % 2 != 0:
			c += 1
			ans.append(l[x + c])
			x += c
		else:
			c += 1
			ans.append(l[x - c])
			x = x - c
	print(*ans)


t = int(input())
result = []
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	sorted_a = [i for i in a]
	sorted_a.sort()
	reverse_sorted_a = [i for i in a]
	reverse_sorted_a.sort(reverse=True)
	(i, j, k) = (0, 0, len(a) - 1)
	while k >= 0:
		if i == j:
			a[k] = str(sorted_a[i])
			i += 1
		else:
			a[k] = str(reverse_sorted_a[j])
			j += 1
		k -= 1
	result.append(' '.join(a))
print('\n'.join(result))


def solve(arr):
	arr.sort()
	sorted = []
	(i, j) = (0, len(arr) - 1)
	while i <= j:
		if i == j:
			sorted.append(arr[i])
			i += 1
		else:
			sorted.append(arr[i])
			sorted.append(arr[j])
			i += 1
			j -= 1
	return ' '.join([str(x) for x in sorted[::-1]])
m = int(input())
for _ in range(m):
	input()
	arr = list(map(int, input().split()))
	print(solve(arr))


t = int(input().strip())
for iter in range(t):
	n = int(input().strip())
	arr = [int(i) for i in input().split()]
	arr.sort()
	if len(arr) % 2 == 0:
		right = len(arr) // 2
		left = right - 1
	else:
		left = len(arr) // 2
		right = left + 1
	parity = 0
	first = True
	while True:
		if not first:
			print(end=' ')
		else:
			first = False
		if parity == 0:
			if left < 0:
				break
			print(arr[left], end='')
			left -= 1
		else:
			if right >= len(arr):
				break
			print(arr[right], end='')
			right += 1
		parity = 1 - parity
	print()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	arr.sort()
	(front, end) = (0, n - 1)
	while front < end:
		ans.append(arr[front])
		ans.append(arr[end])
		front += 1
		end -= 1
	if n % 2 != 0:
		ans.append(arr[front])
	i = n - 1
	while i >= 0:
		print(ans[i], end=' ')
		i -= 1
	print()


import sys
from collections import deque
I = sys.stdin.readline
for _ in range(int(I())):
	n = int(I())
	arr = deque(sorted(map(int, I().split())))
	ans = deque()
	for i in range(n // 2):
		ans.appendleft(arr.pop())
		ans.appendleft(arr.popleft())
	if arr:
		ans.appendleft(arr.pop())
	print(*ans)


import sys
for _ in range(int(input())):
	n = int(sys.stdin.readline())
	list1 = list(map(int, sys.stdin.readline().split()))
	list1.sort()
	while n != 0:
		print(list1.pop(len(list1) // 2), end=' ')
		n -= 1
	print()


def quicker_partition(tab, p, r):
	x = tab[r]
	i = p - 1
	k = r - 1
	j = p
	while j <= k:
		if tab[j] < x:
			i += 1
			(tab[i], tab[j]) = (tab[j], tab[i])
			j += 1
		elif tab[j] == x:
			(tab[k], tab[j]) = (tab[j], tab[k])
			k -= 1
		else:
			j += 1
	for l in range(r - k):
		(tab[l + i + 1], tab[k + 1 + l]) = (tab[k + 1 + l], tab[l + i + 1])
	return (i, i + r - k + 1)

def quicker_sort(tab, p, r):
	while p < r:
		(left, right) = quicker_partition(tab, p, r)
		if left - p < r - right:
			quicker_sort(tab, p, left)
			p = right
		else:
			quicker_sort(tab, right, r)
			r = left

def sort_out_array(tab):
	quicker_sort(tab, 0, len(tab) - 1)
	i = (len(tab) - 1) // 2
	print(tab[i], end=' ')
	j = i - 1
	k = i + 1
	while j > -1 or k < len(tab):
		if k < len(tab):
			print(tab[k], end=' ')
			k += 1
		if j > -1:
			print(tab[j], end=' ')
			j -= 1
	print()

def get_input():
	number_of_problems = int(input())
	arrays = [0] * number_of_problems
	for i in range(number_of_problems):
		length_of_array = int(input())
		temp = input().split(sep=' ')
		for j in range(length_of_array):
			temp[j] = int(temp[j])
		arrays[i] = temp
	return arrays
arrays_to_sort = get_input()
for array in arrays_to_sort:
	sort_out_array(array)


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	p1 = n - 1
	p2 = 0
	flag = False
	while len(ans) != n:
		if flag:
			ans.append(arr[p1])
			p1 -= 1
			flag = False
		else:
			ans.append(arr[p2])
			p2 += 1
			flag = True
	ans = ans[::-1]
	print(' '.join(map(str, ans)))


def soln(arr):
	arr.sort()
	result = []
	currIndex = (len(arr) - 1) // 2
	result.append(arr[currIndex])
	mult = 1
	for i in range(1, len(arr)):
		currIndex += i * mult
		result.append(arr[currIndex])
		mult *= -1
	return result

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = [int(x) for x in input().split(' ')]
		print(' '.join((str(x) for x in soln(arr))))

def test():
	print(soln([-2, 4, 5, 5, 6]))
main()


def adjacentDiff(A):
	A.sort()
	result = [0] * len(A)
	n = len(A)
	i = n // 2
	k = 0
	if n % 2 == 0:
		i -= 1
	else:
		result[len(result) - 1] = A[0]
	j = i + 1
	while j - i < n:
		result[k] = A[i]
		result[k + 1] = A[j]
		i -= 1
		j += 1
		k += 2
	return result
number_of_arrays = input()
array_inputs = list()
for i in range(int(number_of_arrays)):
	arr_size = input()
	raw_array = input()
	array = list(raw_array.split())
	array = [int(x) for x in array]
	array_inputs.append(array)
for i in range(0, int(number_of_arrays)):
	array_inputs[i] = adjacentDiff(array_inputs[i])
for i in range(0, int(number_of_arrays)):
	print(*array_inputs[i])


K = int(input())
for i in range(K):
	A = int(input())
	B = list(map(int, input().split()))
	B.sort()
	i_ = (A - 1) // 2
	n = 1
	for i in range(A):
		print(B[i_], end=' ')
		i_ += n * (i + 1)
		n *= -1


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	i = 0
	j = len(a) - 1
	ans = []
	while i <= j:
		if i == j:
			ans.append(a[i])
			break
		ans.append(a[i])
		ans.append(a[j])
		i += 1
		j -= 1
	print(*reversed(ans))


t = int(input())
T = [[] for _ in range(t)]
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	L = []
	a.sort()
	while a:
		L.append(str(a.pop(n // 2)))
		n -= 1
	T[i] = ' '.join(L)
for i in range(t):
	print(T[i])


a = int(input())
for i in range(a):
	k = int(input())
	a = sorted(input().split(), key=lambda x: int(x))
	if k % 2 == 0:
		ans = ''
		for j in range(k // 2 - 1, -1, -1):
			print(a[j], a[-1 - j], end=' ')
	else:
		print(a[k // 2], end=' ')
		for j in range(k // 2 - 1, -1, -1):
			print(a[j], a[-1 - j], end=' ')


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [0 for i in range(n)]
	k = n - 1
	if True:
		for i in range(ceil(n // 2)):
			(b[k - 1], b[k]) = (a[i], a[n - i - 1])
			k = k - 2
		if n % 2 != 0:
			b[0] = a[n // 2]
		print(*b)


t = int(input())
while t != 0:
	t -= 1
	a = int(input())
	arr = list(map(int, input().split(' ')))
	arr.sort()
	arr.sort()
	ans = []
	while arr:
		ans.append(arr.pop(len(arr) // 2))
	ans = map(str, ans)
	print(' '.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	k = [n // 2, n // 2 - 1]
	b = []
	for j in range(n):
		if j % 2 == 0:
			b.append(str(a[k[0]]))
			k[0] += 1
		if j % 2 == 1:
			b.append(str(a[k[1]]))
			k[1] -= 1
	print(' '.join(b))


def sol():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	res = [0] * n
	(s, e) = (0, n - 1)
	for i in range(n - 1, -1, -1):
		if i % 2:
			res[i] = a[s]
			s += 1
		else:
			res[i] = a[e]
			e -= 1
	print(*res)
try:
	for _ in range(int(input())):
		sol()
except:
	pass


t = int(input())
for i in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	B = []
	for j in range(len(A) // 2):
		B.append(A[-j - 1])
		B.append(A[j])
	if n % 2 != 0:
		B.append(A[n // 2])
	B = B[::-1]
	print(*B)


t = int(input())
for _ in range(0, t):
	n = int(input())
	Left = 0
	Right = n - 1
	Array = [i for i in map(int, input().split())]
	Array.sort()
	List = []
	while Left <= Right:
		List.append(Array[Left])
		List.append(Array[Right])
		Left += 1
		Right -= 1
	List = List[:n]
	for i in range(0, n):
		print(List[n - 1 - i], end=' ')
	print('\n')


import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def main():
	for _ in range(int(input())):
		n = int(input())
		arr = [int(k) for k in input().split()]
		arr.sort()
		res = []
		for i in range(n // 2):
			res.append(arr[i])
			res.append(arr[n - i - 1])
		if n % 2 != 0:
			res.append(arr[(n + 1) // 2 - 1])
		res = res[::-1]
		print(*res)
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()


I = input
exec(int(I()) * 'I();a=sorted(map(int,I().split()))\nwhile a:print(a.pop(len(a)//2))\n')


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	A = list(map(int, input().split(' ')))
	A.sort()
	B = []
	if n % 2 == 0:
		for i in range((n - 1) // 2, -1, -1):
			B.append(A[i])
			B.append(A[n - i - 1])
	else:
		B.append(A[(n - 1) // 2])
		for i in range((n - 1) // 2 - 1, -1, -1):
			B.append(A[i])
			B.append(A[n - i - 1])
	print(*B)


t = int(input())
for wer in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = (n + 1) // 2 - 1
	r = l + 1
	s = 0
	b = []
	k = True
	while s < n:
		if k:
			b.append(a[l])
			k = False
			s += 1
			l -= 1
		else:
			b.append(a[r])
			k = True
			s += 1
			r += 1
	for i in b:
		print(i, end=' ')
	print('')


for _ in range(int(input())):
	(arr, res) = ([sorted(map(int, input().split())) for i in '..'][1], [])
	for i in range(len(arr) // 2):
		res += [arr[-i - 1], arr[i]]
	res.append(arr[len(arr) // 2] if len(arr) % 2 == 1 else '')
	print(*[n for n in res[::-1] if n != ''])


t = int(input())
for i in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	m = 10 ** 9 + 1
	ans = []
	ind = -1
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[-i - 1])
	if n % 2 == 1:
		ans.append(a[n // 2])
	print(*ans[::-1])


for i in range(int(input())):
	input()
	a = sorted(map(int, input().split()))
	b = a[:len(a) // 2][::-1]
	c = a[len(a) // 2:]
	i = 1
	for i in range(len(c)):
		if i == len(c) - 1 and len(a) % 2:
			print(c[i], end=' ')
		else:
			print(c[i], b[i], end=' ')


x = int(input())
for i in range(x):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	if n % 2 == 0:
		k = n // 2 - 1
	else:
		k = n // 2
	print(a[k], end=' ')
	for i in range(1, n):
		if i % 2 != 0:
			k = k + i
			print(a[k], end=' ')
		else:
			k = k - i
			print(a[k], end=' ')


import sys
input = sys.stdin.readline
Q = int(input())
Query = []
for _ in range(Q):
	N = int(input())
	A = list(map(int, input().split()))
	Query.append((N, A))
for (N, A) in Query:
	A.sort()
	l = 0
	r = N - 1
	ans = []
	for i in range(N):
		if i % 2 == 0:
			ans.append(str(A[l]))
			l += 1
		else:
			ans.append(str(A[r]))
			r -= 1
	print(' '.join(ans[::-1]))


t = int(input())
while t > 0:
	n = int(input())
	x = input().split()
	ls = []
	for i in x:
		ls.append(int(i))
	ls.sort()
	ans = []
	ans.append(ls[n // 2])
	x = n // 2
	i = 1
	for j in range(n - 1):
		if i % 2 == 0:
			x = x + i
		else:
			x = x - i
		ans.append(ls[x])
		i += 1
	for i in ans:
		print(i, end=' ')
	print()
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	l = 0
	r = n - 1
	while l < r:
		ans.append(arr[r])
		ans.append(arr[l])
		l += 1
		r -= 1
	if n % 2 != 0:
		ans.append(arr[n // 2])
	ans.reverse()
	print(*ans)


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	n = int(input())
	import collections
	dat = list(map(int, input().split()))
	dat.sort()
	dat = collections.deque(dat)
	turn = True
	res = collections.deque([])
	while len(res) < n:
		if turn is True:
			turn = False
			x = dat.pop()
			res.appendleft(x)
		else:
			turn = True
			x = dat.popleft()
			res.appendleft(x)
	print(' '.join(list(map(str, res))))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	mid = (n - 1) // 2
	(i, j) = (mid, mid + 1)
	ans = []
	while i >= 0 and j < n:
		ans.append(a[i])
		ans.append(a[j])
		i -= 1
		j += 1
	while i >= 0:
		ans.append(a[i])
		i -= 1
	while j < n:
		ans.append(a[j])
		j += 1
	print(*ans)


import sys
import collections

def read_line():
	return sys.stdin.readline()[:-1]

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

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
t = read_int()
for i in range(t):
	n = read_int()
	a = read_int_line()
	b = list(a)
	b.sort(reverse=True)
	a.sort()
	ans = []
	if n % 2 == 0:
		for i in range(n // 2 - 1, -1, -1):
			ans.append(a[i])
			ans.append(b[i])
	if n % 2 != 0:
		for i in range(n // 2 - 1, -1, -1):
			ans.append(a[i])
			ans.append(b[i])
		ans = [a[n // 2]] + ans
	print(*ans)


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	n = int(input())
	lis = sorted(map(int, input().split()))
	ans = [0] * n
	i = 0
	j = n - 1
	k = n - 1
	while k > 0:
		ans[k] = lis[j]
		ans[k - 1] = lis[i]
		j -= 1
		i += 1
		k -= 2
	if n % 2 != 0:
		ans[0] = lis[n // 2]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr = sorted(arr)
	ans = []
	cnt = 0
	for i in range(n):
		ans.append(arr[-(i + 1)])
		cnt += 1
		if cnt == n:
			break
		ans.append(arr[i])
		cnt += 1
		if cnt == n:
			break
	print(*ans[::-1])


t = int(input())
for i in range(t):
	N = int(input())
	row = [int(g) for g in input().split()]
	row.sort()
	middle = int((len(row) - 1) / 2)
	output = [row[middle]]
	l = middle - 1
	h = middle + 1
	while l >= 0 or h < len(row):
		if h < len(row):
			output.append(row[h])
			h += 1
		if l >= 0:
			output.append(row[l])
			l -= 1
	print(*output)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	half = n // 2 if n % 2 == 0 else n // 2 + 1
	l = 0
	l1 = []
	r = n - 1
	while l < half:
		if l == r:
			l1.append(a[l])
		else:
			l1.append(a[l])
			l1.append(a[r])
		l += 1
		r -= 1
	l1.reverse()
	for item in l1:
		print(item, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	i = 0
	j = len(l) - 1
	r = []
	while i <= j:
		r.append(l[i])
		i += 1
		if j >= i:
			r.append(l[j])
			j -= 1
	r.reverse()
	print(' '.join(map(str, r)))


CASES = int(input())
answers = []
while CASES:
	CASES -= 1
	L = int(input())
	arr = [int(x) for x in input().split(' ')]
	arr.sort()
	new = []
	fwd = 0
	bwd = L - 1
	while fwd <= bwd:
		if fwd == bwd:
			new.append(arr[fwd])
			break
		else:
			new.append(arr[fwd])
			new.append(arr[bwd])
			fwd += 1
			bwd -= 1
	answers.append(new)
for ans in answers:
	print(' '.join([str(x) for x in ans[::-1]]))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush

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

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
INF = float('inf')

def main():
	for _ in range(N()):
		n = N()
		arr = list(RL())
		arr.sort()
		res = []
		(b, e) = (0, n - 1)
		while b <= e:
			if b == e:
				res.append(arr[b])
			else:
				res.append(arr[e])
				res.append(arr[b])
			e -= 1
			b += 1
		print(*res[::-1])
main()


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def array():
	return [int(i) for i in input().split()]
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')
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = array()
	a.sort()
	m = n // 2
	c = 0
	if n % 2 == 1:
		print(a[n // 2], end=' ')
		m = n // 2
		c = 1
		ind = 1
		f = 1
		while c < n:
			if f == 0:
				print(a[m - ind], a[m + ind], end=' ')
			else:
				print(a[m + ind], a[m - ind], end=' ')
			ind += 1
			c += 2
	else:
		m = n // 2 - 1
		k = n // 2
		c = 0
		f = 0
		while c < n:
			if f == 0:
				print(a[m], a[k], end=' ')
			else:
				f = 0
				print(a[k], a[m], end=' ')
			m -= 1
			k += 1
			c += 2
	print()


t = int(input())
while t:
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	a = []
	q = n - 1
	mid = q // 2
	a.append(arr[mid])
	l = mid - 1
	r = mid + 1
	while 1:
		if r <= n - 1:
			a.append(arr[r])
		if l >= 0:
			a.append(arr[l])
		if r >= n and l < +0:
			break
		l = l - 1
		r = r + 1
	print(*a)
	t -= 1


t = int(input())
p = []
for ikn in range(0, t):
	n = int(input())
	s = input().split()
	for i in range(0, n):
		s[i] = int(s[i])
	s.sort()
	d = []
	g = 0
	while len(d) < len(s):
		d.append(s[g])
		d.append(s[n - g - 1])
		g += 1
	if len(d) == n + 1:
		del d[n]
	d.reverse()
	p.append(d)
for i in p:
	for j in i:
		print(j, end=' ')
	print()


T = int(input())
for _ in range(T):
	n = int(input())
	lst = [int(s) for s in input().split()]
	lst.sort()
	ind = n - 1
	ans = [0] * n
	for i in range(n // 2):
		ans[ind] = lst[n - i - 1]
		ind -= 1
		ans[ind] = lst[i]
		ind -= 1
	if n % 2 != 0:
		ans[ind] = lst[n // 2]
	for i in ans:
		print(i, end=' ')
	print()


def sort_diafores(lista, n):
	final = []
	lista.sort()
	l = 0
	r = n - 1
	while l <= r:
		if l == r:
			final += [lista[l]]
		else:
			final += [lista[l], lista[r]]
		l += 1
		r -= 1
	final.reverse()
	return final
t = int(input())
for i in range(t):
	n = int(input())
	lista = input().split()
	for j in range(n):
		lista[j] = int(lista[j])
	for k in sort_diafores(lista, n):
		print(k, end=' ')
	print()


from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from collections import defaultdict as dd, deque

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

def mdata():
	return map(int, data().split())
ans = []
for i in range(int(data())):
	n = int(data())
	A = list(mdata())
	A.sort()
	ans1 = []
	for i in range(n // 2):
		ans1.append(str(A[i]))
		ans1.append(str(A[n - 1 - i]))
	if n % 2 != 0:
		ans1.append(str(A[n // 2]))
	s = ' '.join(ans1[::-1])
	ans.append(s)
print('\n'.join(ans))


def solve():
	n = int(input())
	l1 = list(map(int, input().split()))
	l1.sort()
	l2 = []
	for i in range(0, n // 2):
		l2.append(l1[i])
		l2.append(l1[n - i - 1])
	if n % 2 == 1:
		l2.append(l1[n // 2])
	l2.reverse()
	print(*l2)
for _ in range(int(input())):
	solve()


for _ in ' ' * int(input()):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	a = []
	b = l[:n // 2]
	c = l[n // 2:]
	for i in range(n // 2):
		a.append(c[i])
		a.append(b[n // 2 - i - 1])
	if n % 2 != 0:
		a.append(c[-1])
	print(' '.join((str(i) for i in a)))


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
for c in range(0, t):
	a = inp()
	ls = []
	la = inlt()
	la.sort()
	for d in range(0, a):
		ls.append(la[int(d / 2) if int(d % 2) == 0 else int(a - 1 - int(d / 2))])
	ls.reverse()
	print(' '.join((str(i) for i in ls)))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	a = sorted([int(i) for i in sys.stdin.readline().split()])
	ans = [0] * n
	for i in range(n // 2):
		ans[2 * i] = str(a[i])
		ans[2 * i + 1] = str(a[-i - 1])
	if n % 2 == 1:
		ans[-1] = str(a[n // 2])
	print(' '.join(ans[::-1]))


def solve():
	N = int(input())
	arr = [int(i) for i in input().split()]
	arr.sort()
	(l, r) = (0, len(arr) - 1)
	new_arr = []
	while l <= r:
		if r >= l:
			new_arr.append(arr[r])
			r -= 1
		if l <= r:
			new_arr.append(arr[l])
			l += 1
	print(' '.join(map(str, reversed(new_arr))))
T = int(input())
for t in range(T):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	a = []
	temp = 0
	itr1 = 0
	itr2 = n - 1
	l.sort()
	temp = 0
	while itr1 < itr2:
		a.append(l[itr2])
		a.append(l[itr1])
		itr1 += 1
		itr2 -= 1
		temp += 2
	if itr1 == itr2:
		a.append(l[itr1])
	a.reverse()
	for i in a:
		print(i, end=' ')
	print()


import sys, math
inp = sys.stdin.readline
t = int(inp())
while t:
	t -= 1
	n = int(inp())
	tmp = []
	arr = list(map(int, inp().split()))
	arr = sorted(arr, reverse=True)
	right = n // 2
	left = right - 1
	while left > -1 or right < n:
		if right < n:
			print(arr[right], end=' ')
			right += 1
		if left > -1:
			print(arr[left], end=' ')
			left -= 1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	l = 0
	r = n - 1
	while l <= r:
		ans.append(arr[r])
		ans.append(arr[l])
		r -= 1
		l += 1
	if len(arr) % 2 == 0:
		ans = ans[::-1]
	else:
		ans = ans[:-1]
		ans = ans[::-1]
	for i in ans:
		print(i, end=' ')
	print(' ')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	t1 = [0 for i in range(n)]
	j = 0
	k = n - 1
	q = n - 1
	while j < k:
		if j == 0:
			t1[q] = a[k]
			t1[q - 1] = a[j]
			q -= 2
		else:
			t1[q] = a[k]
			t1[q - 1] = a[j]
			q -= 2
		j += 1
		k -= 1
	if n % 2 == 0:
		pass
	else:
		t1[0] = a[j]
	for i in t1:
		print(i, end=' ')
	print()


import math
t = int(input())
while t:
	n = int(input())
	l = list(map(int, input().split()))
	l1 = []
	tmp = 0
	l.sort()
	if n % 2 != 0:
		i = math.floor(n / 2)
		l1.append(l[i])
		j = i + 1
		i -= 1
	else:
		j = int(n / 2)
		i = j - 1
	while i >= 0 and j < n:
		if n % 2 == 0 and tmp == 0:
			l1.append(l[i])
			l1.append(l[j])
		elif abs(l1[tmp] - l[i]) < abs(l1[tmp] - l[j]):
			tmp += 1
			l1.append(l[j])
			l1.append(l[i])
		else:
			tmp += 1
			l1.append(l[i])
			l1.append(l[j])
		tmp += 1
		i -= 1
		j += 1
	while j < n:
		l1.append(l[j])
		tmp += 1
		j += 1
	print(*l1)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a.sort()
	ans = []
	while len(ans) < n:
		if n % 2 == 0:
			hi = n // 2
			lo = hi - 1
		else:
			mid = n // 2
			ans.append(a[mid])
			hi = mid + 1
			lo = mid - 1
		while len(ans) < n:
			ans.append(a[hi])
			ans.append(a[lo])
			hi += 1
			lo -= 1
	for i in ans:
		print(i, end=' ')
	print()


import sys
import math
import bisect

def solve(A):
	n = len(A)
	A.sort()
	B = []
	if n % 2 == 0:
		i = (n - 1) // 2
		j = i + 1
		while i >= 0 and j < n:
			B.append(A[i])
			B.append(A[j])
			i -= 1
			j += 1
	else:
		mid = (n - 1) // 2
		B.append(A[mid])
		i = mid - 1
		j = mid + 1
		while i >= 0 and j < n:
			B.append(A[i])
			B.append(A[j])
			i -= 1
			j += 1
	return B

def main():
	for _ in range(int(input())):
		n = int(input())
		A = list(map(int, input().split()))
		A = solve(A)
		print(' '.join(list((str(a) for a in A))))
main()


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

def gift():
	for _ in range(t):
		n = int(input())
		arry = list(map(int, input().split()))
		arry.sort()
		ans = []
		if n % 2:
			ans.append(arry[n // 2])
		for i in range(n // 2):
			if n % 2:
				ans.append(arry[n // 2 - i - 1])
				ans.append(arry[n // 2 + i + 1])
			else:
				ans.append(arry[n // 2 - i - 1])
				ans.append(arry[n // 2 + i])
		yield ' '.join((str(x) for x in ans))
t = int(input())
ans = gift()
print(*ans, sep='\n')


import math
for _ in range(int(input())):
	am = int(input())
	arr = list(map(int, input().split()))
	new = []
	arr.sort()
	fl = 0
	for i in range(math.floor(am / 2)):
		i1 = am - i - 1
		i2 = i
		new.append(arr[i1])
		new.append(arr[i2])
	if am % 2 == 1:
		fl = 1
		new.append(arr[math.floor(am / 2)])
	new.reverse()
	print(*new)


def sort_adjacent_differences(v):
	sorted_v = sorted(v)
	result = [0] * len(v)
	i = 0
	j = pos = len(v) - 1
	while i <= j:
		if i == j:
			result[pos] = sorted_v[i]
			break
		larger = sorted_v[j]
		smaller = sorted_v[i]
		result[pos - 1] = smaller
		result[pos] = larger
		pos -= 2
		i += 1
		j -= 1
	return result

def main():
	t = int(input())
	for i in range(t):
		input()
		arr = [int(k) for k in input().split(' ')]
		for e in sort_adjacent_differences(arr):
			print(e, end=' ', sep='\n')
		print()
main()


from math import floor
t = input()
t = int(t)
ar = []
res = []
for i in range(t):
	input()
	data = input()
	ar.append(data.split())
	ar[i] = list(map(int, ar[i]))
for i in range(len(ar)):
	res.append([])
maz = abs(ar[i][0] - ar[i][1])
i1 = 0
i2 = 1
for i in range(t):
	ar[i].sort()
	i1 = floor(int(len(ar[i]) / 2)) - 1
	i2 = i1 + 1
	while i1 > -1 and i2 < len(ar[i]):
		res[i].append(ar[i][i2])
		res[i].append(ar[i][i1])
		i1 -= 1
		i2 += 1
	if len(ar[i]) % 2 != 0:
		res[i].append(ar[i][len(ar[i]) - 1])
for i in range(len(res)):
	print(*res[i], sep=' ')


from collections import deque
cases = int(input())
while cases:
	cases -= 1
	num = int(input())
	arr = sorted(map(int, input().split()))
	ans = []
	arr = deque(arr)
	while arr:
		ans.append(arr.pop())
		if arr:
			ans.append(arr.popleft())
	print(*ans[::-1])


k = int(input())
while k > 0:
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	while len(a) > 0:
		mid = len(a) // 2
		x = a[mid]
		print(x, end=' ')
		a.pop(mid)
	print('\n')
	k -= 1


import math
import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	ans = []
	cur = n // 2
	if n % 2 == 0:
		flag = True
	else:
		flag = False
	for i in range(n):
		if flag == True:
			ans.append(arr[cur])
			cur -= i + 1
			flag = False
		else:
			ans.append(arr[cur])
			cur += i + 1
			flag = True
	print(*ans)


T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a = sorted(a)
	i = n // 2
	d = 0
	sgn = 1
	cnt = 0
	ans = []
	while cnt < n:
		ans.append(a[i])
		cnt += 1
		d = abs(d) + 1
		sgn *= -1
		i += sgn * d
	diff = ans[1] - ans[0]
	print(' '.join(map(str, ans)))


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	sorted_a = sorted(a)
	ans = ['0'] * n
	c = n - 1
	for i in range(n // 2):
		(ans[c], ans[c - 1]) = (str(sorted_a.pop(-1)), str(sorted_a.pop(0)))
		c -= 2
	if n % 2 == 1:
		ans[0] = str(sorted_a[0])
	print(' '.join(ans))


from sys import stdin, stdout
for i in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, input().split(' ')))
	a.sort()
	p = []
	pt1 = n - 1
	pt2 = 0
	for i in range(n):
		if not i % 2:
			p.append(a[pt1])
			pt1 -= 1
		else:
			p.append(a[pt2])
			pt2 += 1
	p.reverse()
	print(*p)


n = int(input())
for i in range(n):
	d = int(input())
	q = [0] * (d + 1)
	a = list(map(int, input().split()))
	a.sort()
	l = 0
	r = len(a) - 1
	for j in range(0, d, 2):
		q[j] = a[l]
		q[j + 1] = a[r]
		l += 1
		r -= 1
	for j in range(d - 1, -1, -1):
		print(q[j], end=' ')
	print()


t = int(input())
for case in range(t):
	n = int(input())
	a = [int(s) for s in input().split()]
	a.sort()
	(left, right) = ((n + 1) // 2, (n + 3) // 2)
	ans = [a[left - 1]]
	for i in range(1, n):
		if i & 1:
			ans.append(a[right - 1])
			right += 1
		else:
			left -= 1
			ans.append(a[left - 1])
	for elem in ans:
		print(elem, end=' ')
	print('')


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = []
	for i in range(n // 2):
		l.append(a[i])
		l.append(a[n - i - 1])
	if n % 2:
		l.append(a[n // 2])
	print(*l[::-1])


for _ in range(int(input())):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	m = n // 2
	b = []
	k = 0
	for i in range(n):
		if i % 2 == 0:
			m = m + k
			b += [a[m]]
		else:
			m = m - k
			b += [a[m]]
		k += 1
	print(*b)


t = int(input())
for tt in range(1, t + 1):
	n = int(input())
	l = list(map(int, input().split()))
	ans = []
	l.sort()
	mid = len(l) // 2
	i = mid
	j = i - 1
	while i < len(l) and j > -1:
		ans.append(l[i])
		ans.append(l[j])
		i += 1
		j -= 1
	while i < len(l):
		ans.append(l[i])
		i += 1
	while j > -1:
		ans.append(l[j])
		j -= 1
	for i in ans:
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	l = n // 2 - 1
	r = n // 2
	b = True
	ans = ''
	for j in range(n):
		if b:
			ans += str(a[r]) + ' '
			r += 1
		else:
			ans += str(a[l]) + ' '
			l -= 1
		b = not b
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = 0
	r = n - 1
	ans = [0 for i in range(n)]
	x = n - 1
	while l <= r:
		if x % 2 == 0:
			ans[x] = a[r]
			r -= 1
		else:
			ans[x] = a[l]
			l += 1
		x -= 1
	print(*ans)


for i in range(int(input())):
	siz = int(input())
	l = [int(i) for i in input().split()]
	l.sort()
	kl = []
	kl1 = l[:siz // 2]
	kl2 = l[siz - 1:siz // 2 - 1:-1]
	for i in range(siz // 2):
		kl.append(kl2[i])
		kl.append(kl1[i])
	if siz % 2:
		kl.append(l[(siz + 1) // 2 - 1])
	kl = kl[::-1]
	kl = [str(i) for i in kl]
	print(' '.join(kl))


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	l1 = []
	if n % 2 == 0:
		j = n // 2 - 1
		while j > -1:
			l1.append(arr[j])
			l1.append(arr[n - 1 - j])
			j -= 1
	else:
		l1.append(arr[n // 2])
		j = n // 2 - 1
		while j > -1:
			l1.append(arr[j])
			l1.append(arr[n - 1 - j])
			j -= 1
	for j in range(n):
		print(l1[j], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	lst = sorted(list(map(int, input().split())))
	ev = []
	a = n // 2
	if n % 2 == 0:
		for j in range(a):
			ev.append(lst[j + a])
			ev.append(lst[a - j - 1])
	else:
		ev.append(lst[a])
		for j in range(a):
			ev.append(lst[j + a + 1])
			ev.append(lst[a - j - 1])
	print(*ev)


from sys import stdin, stdout
t = int(stdin.readline())
for query in range(t):
	n = int(stdin.readline())
	a = stdin.readline().split()
	for x in range(n):
		a[x] = int(a[x])
	a.sort()
	if n % 2 == 1:
		m = n // 2
	else:
		m = n // 2 - 1
	l = a[:m]
	h = a[m + 1:]
	l.reverse()
	stdout.write(str(a[m]) + ' ')
	if n % 2 == 1:
		for x in range(m):
			stdout.write(str(h[x]) + ' ')
			stdout.write(str(l[x]) + ' ')
	else:
		for x in range(m):
			stdout.write(str(h[x]) + ' ')
			stdout.write(str(l[x]) + ' ')
		stdout.write(str(h[x + 1]))
	stdout.write('\n')


for _ in range(int(input())):
	N = int(input())
	X = sorted(list(map(int, input().split())))
	if N % 2 == 1:
		print(X[N // 2], end=' ')
		(i, j) = (N // 2 - 1, N // 2 + 1)
	else:
		(i, j) = (N // 2 - 1, N // 2)
	for _ in range(N // 2):
		print(X[i], X[j], end=' ')
		i -= 1
		j += 1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	s = 0
	e = n - 1
	pos = n - 1
	ans = a[:]
	while s < e:
		ans[pos] = a[s]
		pos -= 1
		s += 1
		ans[pos] = a[e]
		pos -= 1
		e -= 1
	if s == e:
		ans[pos] = a[s]
		pos -= 1
	assert pos == -1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	output = []
	right = n // 2
	left = right - 1
	while True:
		if right < n:
			output.append(a[right])
		else:
			break
		if left >= 0:
			output.append(a[left])
		else:
			break
		left -= 1
		right += 1
	print(*output)


t = int(input())
ans = []
for s in range(t):
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	copy = []
	l = 0
	r = n - 1
	c = 1
	while l <= r:
		if c % 2 != 0:
			copy.append(arr[r])
			r = r - 1
		elif c % 2 == 0:
			copy.append(arr[l])
			l = l + 1
		c += 1
	copy.reverse()
	ans.append(copy)
for row in ans:
	print(*row, sep=' ')


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	arr = sorted(arr)
	current = n // 2
	count = 1
	sign = -1
	while 0 <= current < n:
		print(arr[current], end=' ')
		current = current + count * sign
		count += 1
		sign *= -1
	print()


t = int(input().strip())
for i in range(t):
	l = int(input().strip())
	arr = [int(j) for j in input().strip().split()]
	arr = sorted(arr)
	(start, end, res) = (0, len(arr) - 1, [])
	while end - start >= 0:
		res.append(str(arr[end]))
		if start != end:
			res.append(str(arr[start]))
		end -= 1
		start += 1
	print(' '.join(reversed(res)))


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
test = int(input().strip())
for t in range(0, test):
	n = int(input().strip())
	a = [int(x) for x in input().strip().split()]
	a.sort()
	for i in range(n // 2):
		print(a[n // 2 + i], a[n // 2 - 1 - i], end=' ')
	if n % 2 == 1:
		print(a[-1], end='')
	print()
	ans = solve()


import sys
t = int(input())
for _ in range(t):
	n = int(input())
	line = [int(c) for c in input().split()]
	line.sort()
	mid = n // 2
	if n % 2 == 0:
		res = []
		(left, right) = (mid - 1, mid)
	else:
		res = [line[mid]]
		(left, right) = (mid - 1, mid + 1)
	while left >= 0 and right < n:
		res.append(line[left])
		res.append(line[right])
		left -= 1
		right += 1
	print(*res)


t = int(input())
for i in range(t):
	n = int(input())
	l = sorted(list(map(int, input().split())))
	i0 = (n - 1) // 2
	dx = 0
	for j in range(n):
		print(l[i0 + dx], end=' ')
		if dx <= 0:
			dx = -dx + 1
		else:
			dx = -dx
	print()


for test_c in range(int(input())):
	n = int(input())
	lt = sorted(list(map(int, input().split())))
	nlt = []
	j = n // 2
	k = n // 2 - 1
	if n % 2 != 0:
		j = n // 2 + 1
		nlt.append(lt[n // 2])
	for i in range(n // 2):
		nlt.append(lt[j])
		nlt.append(lt[k])
		j += 1
		k -= 1
	print(*nlt)


for t in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	lst.sort()
	lstmin = lst[n // 2:][::-1]
	lstmax = lst[:n // 2]
	ans = []
	if n % 2:
		ans += [lstmin[0]]
		for i in range(len(lstmax)):
			ans += [lstmax[i], lstmin[i + 1]]
	else:
		for i in range(len(lstmin)):
			ans += [lstmin[i], lstmax[i]]
	print(*ans[::-1])


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	m = n // 2
	b = []
	b.append(a[m])
	for i in range(1, n // 2 + 1):
		if m - i >= 0:
			b.append(a[m - i])
		if m + i < n:
			b.append(a[m + i])
	for i in range(n - 1):
		print(b[i], end=' ')
	print(b[-1])


for i in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	ans = []
	a.sort()
	for i in range(n // 2):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	ans = ans[::-1]
	if n % 2:
		ans.insert(0, a[(n - 1) // 2])
	print(*ans)


import sys
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

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

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

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

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

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 998244353
for _ in range(int(ri())):
	n = int(ri())
	a = Ri()
	a.sort()
	ans = []
	i = 0
	j = n - 1
	while i < j:
		ans.append(a[j])
		ans.append(a[i])
		i += 1
		j -= 1
	if i == j:
		ans.append(a[i])
	print(*ans[::-1])


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	(l, r) = (n // 2 - 1, n // 2)
	ans = []
	for i in range(n):
		if (r - l) % 2 == 1:
			ans.append(a[r])
			r += 1
		else:
			ans.append(a[l])
			l -= 1
	print(' '.join(map(str, ans)))


for _ in range(int(input())):
	num = int(input())
	numbers = sorted(list(map(int, input().split())))
	if num % 2 == 1:
		print(numbers[num // 2], end=' ')
	for x in range(num // 2 - 1, -1, -1):
		print(numbers[x], numbers[-x - 1], end=' ')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip()
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
from collections import deque
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	d = deque(a)
	ans = []
	turn = 0
	while len(d):
		if not turn:
			ans.append(d.pop())
		else:
			ans.append(d.popleft())
		turn ^= 1
	ans.reverse()
	print(*ans)


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

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

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	n = I()
	a = L()
	a.sort()
	ind = (n + 1) // 2 - 1
	dir = 1
	for i in range(n):
		print(a[ind], end=' ')
		ind += dir * (i + 1)
		dir *= -1
	print()


import sys
input = sys.stdin.readline
read = lambda : map(int, input().split())
read_float = lambda : map(float, input().split())

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

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

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

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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

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

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

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

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

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

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

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

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

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

def str_array():
	return input().strip().split()

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

def check(l, ps, n, t):
	for i in range(n - l + 1):
		if ps[i + l] - ps[i] <= t:
			return True
	return False
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
import bisect as bis
import random
import sys

def solve():
	n = int(input())
	a = list(read())
	a.sort()
	ans = []
	if n % 2 == 1:
		ans.append(a[n // 2])
	for i in range(n // 2 - 1, -1, -1):
		ans.append(a[i])
		ans.append(a[n - i - 1])
	print(*ans)
for _ in range(int(input())):
	solve()


import sys
input = sys.stdin.buffer.readline
uu = int(input())
while uu:
	uu -= 1
	n = int(input())
	arr = [int(x) for x in input().split()]
	arr.sort()
	newarr = [0 for i in range(n)]
	ll = n - 1
	t = 0
	k = -1
	ans = 0
	curr = -1
	while ll >= 0:
		newarr[ll] = arr[ans]
		if ans < 0:
			k -= 1
			ans = t
		else:
			t += 1
			ans = k
		ll -= 1
	print(*newarr)


t = int(input())
for _ in range(t):
	n = int(input())
	ls = list(map(int, input().strip().split()))
	ls.sort()
	i = 0
	j = n - 1
	ans = []
	k = 0
	while k < n:
		ans.append(ls[j])
		j -= 1
		k += 1
		if k < n:
			ans.append(ls[i])
			i += 1
			k += 1
	ans = reversed(ans)
	print(*ans)


t = int(input())

def f(x):
	if x == 1:
		return 1
	if x == 2:
		return 2
	return f(x - 1) + 1
for _ in range(t):
	n = int(input())
	a = sorted(list(map(int, input().split())))
	b = [0] * n
	for i in range(n):
		if i % 2 == 0:
			b[n - i - 1] = a[n - i // 2 - 1]
		else:
			b[n - i - 1] = a[i // 2]
	print(*b)


for _ in range(int(input())):
	n = int(input())
	L = list(map(int, input().split()))
	L.sort()
	ans = []
	(l, r) = (0, n - 1)
	while l < r:
		ans.append(L[l])
		ans.append(L[r])
		l += 1
		r -= 1
	if l == r:
		ans.append(L[l])
	print(*ans[::-1])


t = int(input())
for q in range(t):
	n = int(input())
	entrada = list(map(int, input().split(' ')))
	entrada.sort()
	if n % 2 == 0:
		p1 = list(reversed(entrada[:n // 2]))
		p2 = entrada[n // 2:]
		for k in range(n):
			if k % 2 == 0:
				print(p1[k // 2], end=' ')
			else:
				print(p2[k // 2], end=' ')
		print()
	else:
		p1 = list(reversed(entrada[:n // 2]))
		p2 = entrada[n // 2:]
		print(p2[0], end=' ')
		p2.remove(p2[0])
		for k in range(n - 1):
			if k % 2 == 0:
				print(p1[k // 2], end=' ')
			else:
				print(p2[k // 2], end=' ')
		print()


t = int(input())
for tt in range(t):
	n = int(input())
	a = [int(s) for s in input().split()]
	a.sort()
	b = [a[0]]
	for i in range(1, n // 2 + 1):
		b.append(a[n - i])
		if i != n - i:
			b.append(a[i])
	print(*b[::-1])


import math
import sys

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
test_cases = int(input())
for _ in range(test_cases):
	length_arr = int(input())
	arr = inlt()
	arr.sort()
	if length_arr % 2 == 0:
		i = int(length_arr / 2 - 1)
		while i >= 0:
			print(arr[i])
			print(arr[length_arr - i - 1])
			i -= 1
	else:
		i = int(length_arr // 2)
		print(arr[i])
		arr.pop(i)
		i -= 1
		while i >= 0:
			print(arr[i])
			print(arr[length_arr - i - 2])
			i -= 1


for _ in range(int(input())):
	a = int(input())
	l = list(map(int, input().split()))
	l.sort()
	v = []
	if a % 2 != 0:
		v.append(l[a // 2])
	for i in range(a // 2 - 1, -1, -1):
		v.append(l[a - i - 1])
		v.append(l[i])
	print(*v)


import sys
input = sys.stdin.readline
from math import *
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	if n <= 2:
		print(*a)
		continue
	if n % 2 == 0:
		b = a[:n // 2][::-1]
		c = a[n // 2:]
		print(b[0], end=' ')
		for i in range(0, len(c)):
			print(c[i], end=' ')
			if i == len(b) - 1:
				break
			else:
				print(b[i + 1], end=' ')
	else:
		b = a[:n // 2][::-1]
		c = a[n // 2:]
		if abs(b[0] - c[0]) < abs(c[0] - c[1]):
			print(b[0], end=' ')
			print(c[0], end=' ')
		else:
			print(c[0], end=' ')
			print(b[0], end=' ')
		for i in range(0, len(c) - 1):
			print(c[i + 1], end=' ')
			if i == len(b) - 1:
				break
			else:
				print(b[i + 1], end=' ')
	print()


t = int(input())
for rep in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = []
	for i in range(n // 2):
		l.append(str(a[i]))
		l.append(str(a[n - 1 - i]))
	if n % 2 == 1:
		l.append(str(a[(n - 1) // 2]))
	l.reverse()
	print(' '.join(l))


t = int(input())
for i in range(t):
	n = int(input())
	s = [int(j) for j in input().split()]
	s = sorted(s)
	k = len(s) // 2
	a = []
	for j in range(k):
		a.append(s[k + j])
		a.append(s[k - j - 1])
	if len(s) % 2 == 1:
		a.append(s[len(s) - 1])
	print(' '.join(map(str, a)))


x = int(input())
for z in range(x):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	l1 = []
	for i in range(n // 2):
		l1.extend([l[i], l[-1 - i]])
	if n % 2 != 0:
		l1.append(l[n // 2])
	print(*l1[::-1])


def isGood(lista):
	for i in range(len(lista) - 1):
		if abs(lista[i] - lista[i + 1]) > abs(lista[i + 1] - lista[i + 2]):
			return False
	return True

def selecionaOutliers(lista):
	ordenada = []
	lista.sort()
	n = len(lista)
	for i in range(n // 2):
		ordenada.append(lista[-i - 1])
		ordenada.append(lista[i])
	if n % 2 == 1:
		ordenada.append(lista[n // 2])
	return ordenada
n = int(input())
for i in range(n):
	x = int(input())
	lista = list(map(int, input().split(' ')))
	lista = selecionaOutliers(lista)
	lista.reverse()
	print(' '.join((str(x) for x in lista)))


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	M = [a[n // 2]]
	for i in range(1, n // 2):
		M.append(a[n // 2 - i])
		M.append(a[n // 2 + i])
	M.append(a[0])
	if n % 2 == 1:
		M.append(a[n - 1])
	for e in M:
		print(e, end=' ')
	print()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	l = r = (n - 1) // 2
	r = l + 1
	ans = []
	while l >= 0 and r < n:
		ans.append(a[l])
		ans.append(a[r])
		r += 1
		l -= 1
	while l >= 0:
		ans.append(a[l])
		l -= 1
	while r < n:
		ans.append(a[r])
		r += 1
	print(*ans)


t = int(input())
for test in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	res = []
	arr.sort()
	if n % 2 == 0:
		ptr = n // 2 - 1
		while ptr >= 0:
			res.append(arr[ptr])
			res.append(arr[n - 1 - ptr])
			ptr -= 1
	else:
		ptr = n // 2
		res.append(arr[ptr])
		ptr -= 1
		while ptr >= 0:
			res.append(arr[ptr])
			res.append(arr[n - 1 - ptr])
			ptr -= 1
	print(*res)


import sys

def I():
	return sys.stdin.readline().rstrip()
for _ in range(int(I())):
	n = int(I())
	l = list(map(int, I().split()))
	l.sort()
	r = []
	i = (n - 1) // 2
	j = i + 1
	while i >= 0 or j < n:
		if i >= 0:
			r.append(l[i])
			i -= 1
		if j < n:
			r.append(l[j])
			j += 1
	print(*r)


from math import *
from collections import *
from operator import itemgetter
import bisect
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	n = ii()
	a = iia()
	a.sort()
	b = []
	for i in range(n // 2):
		b.append(a[i])
		b.append(a[-(i + 1)])
	if n % 2:
		b.append(a[n // 2])
	b = list(reversed(b))
	print(*b)


t = int(input())
for test_case in range(t):
	n = int(input())
	avals = list(map(int, input().split(' ')))
	if n < 3:
		for x in avals:
			print(str(x), end=' ')
	else:
		avals.sort()
		m = n // 2
		if n % 2 == 0:
			for i in range(n // 2):
				print(avals[m - i - 1], end=' ')
				print(avals[m + i], end=' ')
		else:
			print(avals[m], end=' ')
			if avals[m] - avals[m - 1] < avals[m + 1] - avals[m]:
				for i in range(1, n // 2 + 1):
					print(avals[m - i], end=' ')
					print(avals[m + i], end=' ')
			else:
				for i in range(1, n // 2 + 1):
					print(avals[m + i], end=' ')
					print(avals[m - i], end=' ')
	print()


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

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

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	l = []
	for _ in range(t):
		n = I()
		a = LI()
		a.sort()
		nl = []
		(i, j) = (0, n - 1)
		while i <= j:
			if i != j:
				nl.append(a[i])
				nl.append(a[j])
			else:
				nl.append(a[i])
			i += 1
			j -= 1
		nl.reverse()
		print(*nl)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	b = []
	for i in range(n // 2):
		b.append(a[i])
		b.append(a[n - i - 1])
	if n % 2 == 1:
		b.append(a[n // 2])
	for i in range(n):
		b[i] = str(b[i])
	b.reverse()
	print(' '.join(b))


from collections import deque
t = int(input())
for _ in range(t):
	l = int(input())
	arr = deque(sorted([int(x) for x in input().strip('\n').split(' ')]))
	new_arr = deque()
	while arr:
		x = arr.popleft()
		if len(arr) != 0:
			y = arr.pop()
			new_arr.append(y)
		new_arr.append(x)
	new_arr = list(reversed(new_arr))
	print(' '.join((str(x) for x in new_arr)))


T = int(input())
for t in range(T):
	N = int(input())
	A = [int(_) for _ in input().split()]
	A = sorted(A)
	i = len(A) // 2
	res = [A[i]]
	k = 0
	while len(res) != len(A):
		k += 1
		if i - k >= 0:
			res.append(A[i - k])
		if i + k < len(A):
			res.append(A[i + k])
	print(' '.join(map(str, res)))


for _ in range(int(input())):
	n = int(input())
	vals = list(map(int, input().split()))
	vals.sort()
	mid = n // 2
	new = []
	if n % 2 == 0:
		mid -= 1
	new.append(vals[mid])
	for i in range(1, n // 2 + 1):
		if mid + i <= n - 1:
			new.append(vals[mid + i])
		if mid - i >= 0:
			new.append(vals[mid - i])
	print(*new)


t = int(input())
for tc in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	a.sort()
	b = a[::-1]
	first = True
	s = ''
	if n == 1:
		s = str(a[0])
	elif n % 2 is not 0:
		s += str(a[int(n / 2)])
		for i in range(int(n / 2) - 1, -1, -1):
			s += ' '
			s += str(a[i]) + ' ' + str(b[i])
			first = False
	else:
		for i in range(int(n / 2) - 1, -1, -1):
			if not first:
				s += ' '
			s += str(a[i]) + ' ' + str(b[i])
			first = False
	print(s)


for _ in range(int(input())):
	d = int(input())
	f = list(map(int, input().split()))
	f.sort()
	op = []
	if d % 2 == 0:
		g = f[:d // 2]
		g = g[::-1]
		k = f[d // 2:]
		for i in range(len(g)):
			op.append(g[i])
			op.append(k[i])
		print(*op)
	else:
		g = f[:d // 2]
		g = g[::-1]
		k = f[d // 2:]
		for i in range(len(g)):
			op.append(k[len(k) - 1 - i])
			op.append(g[len(g) - 1 - i])
		op.append(k[0])
		print(*op[::-1])


import math
import os
import random
import re
import sys
k = input()
for i in range(int(k)):
	length = int(input())
	arr = input().split()
	arr = [int(x) for x in arr]
	arr.sort()
	mid = (length + 1) // 2 - 1
	arr1 = str()
	sign = 1
	for j in range(length):
		sign *= -1
		arr1 += str(arr[mid + j * sign]) + ' '
		mid += j * sign
	print(arr1)


t = int(input())
for i in range(t):
	n = int(input())
	num = list(map(int, input().split()))
	num.sort()
	f = 1
	if n % 2 == 0:
		l = n // 2 - 1
		r = n // 2
		for j in range(n // 2):
			print(num[l], num[r], end=' ')
			l = l - 1
			r = r + 1
	elif n % 2 != 0:
		l = n // 2
		r = n // 2
		print(num[l], end=' ')
		for j in range(n // 2):
			l = l - 1
			r = r + 1
			print(num[l], num[r], end=' ')
	print()


t = int(input(''))
arr = []
for i in range(t):
	input('')
	arr.append(list(map(int, input().split())))
for a in arr:
	n = len(a)
	a.sort()
	shuru = 0
	shesh = n - 1
	sol = []
	flag = 0
	while len(sol) < n:
		if flag == 0:
			sol.append(a[shuru])
			shuru += 1
		else:
			sol.append(a[shesh])
			shesh -= 1
		flag = 1 - flag
	sol.reverse()
	print(*sol)


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = sorted(list(map(int, input().split(' '))))
		median = n // 2
		z = 1
		if n % 2 != 0:
			l = [str(a[median])]
			while True:
				l.append(str(a[median + z]))
				l.append(str(a[median - z]))
				z += 1
				if median + z >= n:
					break
		else:
			l = [str(a[median]), str(a[median - 1])]
			while True:
				l.append(str(a[median + z]))
				l.append(str(a[median - z - 1]))
				z += 1
				if median + z >= n:
					break
		print(' '.join(l))
main()


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	ans = []
	for i in range(len(l) // 2):
		ans.append(str(l[len(l) - i - 1]))
		ans.append(str(l[i]))
	if len(l) % 2 == 1:
		ans.append(str(l[len(l) // 2]))
	print(' '.join(ans[-1::-1]))


t = int(input())
r = []
for eeeee in range(t):
	n = int(input())
	a = [int(aaa) for aaa in input().split()]
	a.sort()
	k = []
	for i in range(n // 2):
		k.append(a[-i - 1])
		k.append(a[i])
	if n % 2 == 1:
		k.append(a[n // 2])
	r.append(k)
for i in range(t):
	e = r[i]
	for j in range(len(r[i]) - 1):
		print(e[-j - 1], end=' ')
	print(e[0])


t = int(input())
for i in range(t):
	n = int(input())
	nums = list(map(int, input().split()))
	nums.sort()
	if n % 2 == 0:
		middle = n // 2
		bm = middle - 1
		out = []
		while middle < n:
			out.append(str(nums[bm]))
			out.append(str(nums[middle]))
			middle += 1
			bm -= 1
		print(' '.join(out))
	else:
		temp = nums[1:]
		first = nums[0]
		middle = len(temp) // 2
		bm = middle - 1
		out = []
		while middle < len(temp):
			out.append(str(temp[bm]))
			out.append(str(temp[middle]))
			middle += 1
			bm -= 1
		out.append(str(first))
		print(' '.join(out))


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	n = int(input())
	a = li()
	a.sort()
	d = defaultdict(list)
	a.sort()
	ans = []
	for i in range(1, n // 2 + 1):
		ans.append(a[i - 1])
		ans.append(a[-i])
	if n % 2:
		ans.append(a[n // 2])
	print(*ans[::-1])
for _ in range(int(input())):
	case()


T = int(input())

def solve():
	N = int(input())
	A = list(map(int, input().split()))
	A = sorted(A)
	ans = []
	idx_left = (len(A) - 1) // 2
	idx_right = idx_left + 1
	while idx_left >= 0 or idx_right < len(A):
		if idx_left >= 0:
			ans.append(A[idx_left])
			idx_left -= 1
		if idx_right < len(A):
			ans.append(A[idx_right])
			idx_right += 1
	print(' '.join([str(x) for x in ans]))
for _ in range(T):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = sorted(a)
	c = sorted(a, reverse=True)
	d = 0
	d1 = 0
	i = 0
	l = []
	for i in range(n):
		if i % 2 != 0:
			l.append(b[d])
			d += 1
		else:
			l.append(c[d1])
			d1 += 1
	l.reverse()
	print(*l)


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

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

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

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

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

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		n = II()
		aa = LI()
		aa.sort()
		i = n // 2
		j = i - 1
		ans = []
		while i < n:
			ans.append(aa[i])
			i += 1
			if j < 0:
				break
			ans.append(aa[j])
			j -= 1
		print(*ans)
main()


for _ in range(int(input())):
	n = int(input())
	ls = list(map(int, input().split()))
	ls.sort()
	i = n // 2 - 1
	j = i + 1
	while True:
		if j < n:
			print(ls[j], end=' ')
			j += 1
		if i >= 0:
			print(ls[i], end=' ')
			i -= 1
		if i < 0 and j >= n:
			break
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	lf = []
	l.sort()
	if n % 2 == 0:
		l1 = l[:n // 2]
		l2 = l[n // 2:]
		l1.reverse()
		for i in range(n // 2):
			lf.append(l1[i])
			lf.append(l2[i])
	else:
		l1 = l[:n // 2]
		l2 = l[n // 2 + 1:]
		ind = l[n // 2]
		l1.reverse()
		lf.append(ind)
		for i in range(n // 2):
			lf.append(l1[i])
			lf.append(l2[i])
	print(*lf)


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	l.sort()
	left = 0
	right = n - 1
	arr = [0 for j in range(n)]
	count = 1
	for j in range(n):
		if j % 2 == 0:
			arr[n - count] = l[left]
			left += 1
		else:
			arr[n - count] = l[right]
			right -= 1
		count += 1
	print(*arr, sep=' ')


def run_on_input():
	num_test_cases = int(input())
	for i in range(num_test_cases):
		arr_len = int(input())
		arr = list(map(int, input().split()))
		sorted_adjacent_diff(arr)

def print_after_return(func):

	def wrapper(*args, **kwargs):
		returned = func(*args, **kwargs)
		if isinstance(returned, list) or isinstance(returned, tuple):
			string = ' '.join(map(str, returned))
			print(string)
		else:
			print(returned)
	return wrapper

@print_after_return
def sorted_adjacent_diff(arr):
	arr.sort()
	medians = ping_pong_array(arr)
	out = [median for median in medians]
	return out

def ping_pong_array(arr):
	median = len(arr) // 2
	jump = -1
	while median >= 0 and median < len(arr):
		yield arr[median]
		median += jump
		jump = (abs(jump) + 1) * (jump // abs(jump))
		jump *= -1
run_on_input()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	l = 0
	r = n - 1
	vals = []
	while l < r:
		vals.append(arr[l])
		vals.append(arr[r])
		l += 1
		r -= 1
		if l == r:
			vals.append(arr[l])
			break
	print(*vals[::-1])


T = int(input())
for i in range(T):
	N = int(input())
	a = list(map(int, input().split()))
	a.sort()
	n = len(a)
	while n != 0:
		print(a.pop(n // 2), end=' ')
		n -= 1


R = lambda : map(int, input().split())
t = int(input())

def solve(a, n):
	m = n // 2
	b = []
	k = 0
	for i in range(n):
		if i % 2:
			b.append(a[m - k])
		else:
			b.append(a[m + k])
			k += 1
	return b
for _ in range(t):
	n = int(input())
	a = sorted(list(R()))
	print(*solve(a, n))


t = int(input())
for i in range(t):
	n = int(input())
	res = [0] * n
	a = list(map(int, input().split()))
	a.sort()
	p = 0
	q = len(a) - 1
	j = q
	bool = True
	while j >= 0:
		if bool:
			res[j] = a[q]
			bool = False
			q -= 1
			j -= 1
		else:
			bool = True
			res[j] = a[p]
			p += 1
			j -= 1
	print(*res)


from sys import stdin, stdout
T = int(input())
for i in range(T):
	N = int(input())
	arr = input().split()
	arr = list(map(int, arr))
	arr.sort()
	(l, r) = (0, len(arr) - 1)
	op = []
	while l < r:
		op.append(arr[r])
		op.append(arr[l])
		l += 1
		r -= 1
	if l == r:
		op.append(arr[l])
	for i in range(len(arr) - 1, -1, -1):
		print(op[i], end=' ')
	print('')


t = int(input())
for case_num in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	a.sort()
	ans = []
	l = 0
	r = n - 1
	while l <= r:
		ans.append(a[l])
		if l < r:
			ans.append(a[r])
		l += 1
		r -= 1
	ans.reverse()
	print(' '.join(map(str, ans)))


testCases = int(input())
while testCases:
	lenArr = int(input())
	arr = list(map(int, input().split()))
	arr.sort()
	newArr = []
	pair1 = (lenArr - 1) // 2
	pair2 = (lenArr - 1) // 2 + 1
	lenNewArr = 0
	if lenArr % 2 == 0:
		while lenNewArr < lenArr:
			newArr.append(str(arr[pair1]))
			newArr.append(str(arr[pair2]))
			pair1 -= 1
			pair2 += 1
			lenNewArr += 2
	else:
		newArr.append(str(arr[pair1]))
		pair1 -= 1
		while lenNewArr < lenArr - 1:
			newArr.append(str(arr[pair1]))
			newArr.append(str(arr[pair2]))
			pair1 -= 1
			pair2 += 1
			lenNewArr += 2
	print(' '.join(newArr))
	testCases -= 1


t = int(input())
for ti in range(t):
	n = int(input())
	a = input().split()
	a = [int(i) for i in a]
	a.sort()
	b = []
	for i in range(n):
		if i % 2 == 1:
			b.append(a[int((i - 1) / 2)])
		else:
			b.append(a[int(n - (i + 2) / 2)])
	b.reverse()
	print(*b)


import sys

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

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

def solve(values):
	sorted_values = list(sorted(values))
	result = []
	while len(sorted_values) > 0:
		result.append(sorted_values[0])
		del sorted_values[0]
		if len(sorted_values) > 0:
			result.append(sorted_values[-1])
			del sorted_values[-1]
	return list(reversed(result))

def println_list(array):
	for i in range(len(array) - 1):
		sys.stdout.write(str(array[i]) + ' ')
	sys.stdout.write(str(array[-1]) + '\n')
results = []
cycles = read_int()
for cycle in range(cycles):
	n = read_int()
	values = read_list()
	results.append(solve(values))
for r in results:
	println_list(r)


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	B = []
	i = 0
	prev = 0
	nxt = 0
	if n % 2 == 0:
		i = n // 2 - 1
		prev = n // 2 - 1
		nxt = n // 2 - 1
	if n % 2 != 0:
		i = n // 2
		prev = n // 2
		nxt = n // 2
	B.append(A[i])
	while prev >= 0 or nxt < n:
		prev -= 1
		nxt += 1
		if nxt < n:
			B.append(A[nxt])
		if prev >= 0:
			B.append(A[prev])
	print(*B)


from math import factorial as fac
from collections import defaultdict
from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def is_perfect_square(num):
	for i in range(2, 20):
		for j in range(1, num + 1):
			if j ** i == num:
				return True
	return False

def get_sum_perfect(num):
	res = 0
	for i in range(1, num + 1):
		if num % i == 0:
			if is_perfect_square(i):
				res += i
	return res

def real_solution(n):
	res = 0
	for i in range(1, n + 1):
		res += get_sum_perfect(i)
	return res
default_progs = [modinv(4), modinv(4), modinv(4)]
from random import randint
DEBUG = False

def solution1(N):
	result = N % NUMBER
	klom = int(N ** (1 / 3)) + 2
	for num in range(2, klom):
		if num in s:
			continue
		x = num ** 2
		power = num ** 2
		for p in range(2, int(math.log(N, num)) + 2):
			result = plus(result, mult(N // power, power))
			power *= num
	for num in range(klom, 2 * (int(N ** (1 / 3)) + 2)):
		result = plus(result, N * N * N)
	return result % NUMBER

def solution(A, N):
	A.sort()
	res = []
	index = N // 2
	for i in range(N):
		index = index + (-1) ** i * i
		res.append(A[index])
	return ' '.join(map(str, res))

def main():
	T = read_int()
	for i in range(T):
		N = read_int()
		A = read_int_array()
		print(solution(A, N))

def main1():
	T = read_int()
	for i in range(T):
		N = read_int()
		print(solution(N))
main()