description: You are given a sequence a_1, a_2, ..., a_n consisting of n pairwise distinct positive integers.
  
  Find \left⌊ \frac n 2 \right⌋ different pairs of integers x and y such that: 
  
    * x ≠ y; 
    * x and y appear in a; 
    * x~mod~y doesn't appear in a. 
  
  
  
  Note that some x or y can belong to multiple pairs.
  
  ⌊ x ⌋ denotes the floor function — the largest integer less than or equal to x. x~mod~y denotes the remainder from dividing x by y.
  
  If there are multiple solutions, print any of them. It can be shown that at least one solution always exists.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases.
  
  The first line of each testcase contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the length of the sequence.
  
  The second line of each testcase contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^6).
  
  All numbers in the sequence are pairwise distinct. The sum of n over all testcases doesn't exceed 2 ⋅ 10^5.
  
  Output
  
  The answer for each testcase should contain \left⌊ \frac n 2 \right⌋ different pairs of integers x and y such that x ≠ y, x and y appear in a and x~mod~y doesn't appear in a. Print the pairs one after another.
  
  You can print the pairs in any order. However, the order of numbers in the pair should be exactly such that the first number is x and the second number is y. All pairs should be pairwise distinct.
  
  If there are multiple solutions, print any of them.
  
  Example
  
  Input
  
  
  4
  2
  1 4
  4
  2 8 3 4
  5
  3 8 5 9 7
  6
  2 7 5 3 4 8
  
  
  Output
  
  
  4 1
  8 2
  8 4
  9 5
  7 5
  8 7
  4 3
  5 2
  
  Note
  
  In the first testcase there are only two pairs: (1, 4) and (4, 1). \left⌊ \frac 2 2 \right⌋=1, so we have to find one pair. 1~mod~4=1, and 1 appears in a, so that pair is invalid. Thus, the only possible answer is a pair (4, 1).
  
  In the second testcase, we chose pairs 8~mod~2=0 and 8~mod~4=0. 0 doesn't appear in a, so that answer is valid. There are multiple possible answers for that testcase.
  
  In the third testcase, the chosen pairs are 9~mod~5=4 and 7~mod~5=2. Neither 4, nor 2, appears in a, so that answer is valid.
solution: import java.util.*;
  import java.io.*;
  
  public class Practice {
  	static boolean multipleTC = true;
  	FastReader in;
  	PrintWriter out;
  
  	static int mod = (int) (1e9 + 7);
  
  	public static void main(String[] args) throws Exception {
  		new Practice().run();
  	}
  
  	void run() throws Exception {
  		in = new FastReader();
  		out = new PrintWriter(System.out);
  		int T = (multipleTC) ? ni() : 1;
  		pre();
  		for (int t = 1; t <= T; t++)
  			solve(t);
  		out.flush();
  		out.close();
  	}
  
  	void pre() throws Exception {
  	}
  
  	void solve(int TC) throws Exception {
  		int n = ni();
  		int arr[] = readArr(n);
  		int min = Integer.MAX_VALUE;
  		int minIdx = -1;
  		for (int i = 0; i < n; i++) {
  			if (min > arr[i]) {
  				min = arr[i];
  				minIdx = i;
  			}
  		}
  		int pairs = n / 2;
  		StringBuilder sb = new StringBuilder();
  		for (int i = 0; pairs > 0 && i < n; i++) {
  			if (i == minIdx) {
  				continue;
  			}
  			sb.append(arr[i] + " " + min + "\n");
  			pairs--;
  		}
  		sb.deleteCharAt(sb.length() - 1);
  		pn(sb);
  
  	}
  
  	StringBuilder printArr(int arr[]) {
  		StringBuilder sb = new StringBuilder();
  		int n = arr.length;
  		for (int i = 0; i < n; i++) {
  			sb.append(arr[i] + " ");
  		}
  		return sb;
  	}
  
  	class pair {
  		int x, y;
  
  		pair(int x, int y) {
  			this.x = x;
  			this.y = y;
  		}
  
  		@Override
  		public String toString() {
  			return " " + x + ", " + y + "]";
  		}
  
  	}
  
  	class pairL {
  		long x, y;
  
  		pairL(long x, long y) {
  			this.x = x;
  			this.y = y;
  		}
  
  		@Override
  		public String toString() {
  			return " " + x + ", " + y + "]";
  		}
  
  	}
  
  	boolean isSorted(int arr[]) {
  		for (int i = 0; i < arr.length - 1; i++) {
  			if (arr[i] > arr[i + 1]) {
  				return false;
  			}
  		}
  		return true;
  	}
  
  	void swap(int arr[], int x, int y) {
  		int t = arr[x];
  		arr[x] = arr[y];
  		arr[y] = t;
  	}
  
  	static int bitCount(int x) {
  		return x == 0 ? 0 : (1 + bitCount(x & (x - 1)));
  	}
  
  	void sort(int arr[]) {
  		ArrayList<Integer> list = new ArrayList<>();
  		for (int i = 0; i < arr.length; i++)
  			list.add(arr[i]);
  		Collections.sort(list);
  		for (int i = 0; i < arr.length; i++)
  			arr[i] = list.get(i);
  	}
  
  	static void dbg(Object... o) {
  		System.err.println(Arrays.deepToString(o));
  	}
  
  	ArrayList<Long> primeFactorization(long n) {
  		ArrayList<Long> factorization = new ArrayList<>();
  		while (n % 2 == 0) {
  			factorization.add(2L);
  			n /= 2;
  		}
  		for (long d = 3; d * d <= n; d += 2) {
  			while (n % d == 0) {
  				factorization.add(d);
  				n /= d;
  			}
  		}
  		if (n > 1)
  			factorization.add(n);
  		return factorization;
  	}
  
  	public static boolean isPrime(long n) {
  		if (n < 2)
  			return false;
  		if (n == 2 || n == 3)
  			return true;
  		if (n % 2 == 0 || n % 3 == 0)
  			return false;
  		long sqrtN = (long) Math.sqrt(n) + 1;
  		for (long i = 6L; i <= sqrtN; i += 6) {
  			if (n % (i - 1) == 0 || n % (i + 1) == 0)
  				return false;
  		}
  		return true;
  	}
  
  	public static long gcd(long a, long b) {
  		if (a > b)
  			a = (a + b) - (b = a);
  		if (a == 0L)
  			return b;
  		return gcd(b % a, a);
  	}
  
  	public long binaryExpo(long base, long exp) {
  		long res = 1;
  		while (exp > 0) {
  			if ((exp & 1) == 1)
  				res = res * base;
  			base = base * base;
  			exp >>= 1;
  		}
  		return res;
  	}
  
  	public long pow(long base, long exp, long MOD) {
  		base %= MOD;
  		long res = 1;
  		while (exp > 0) {
  			if ((exp & 1) == 1)
  				res = res * base % MOD;
  			base = base * base % MOD;
  			exp >>= 1;
  		}
  		return res;
  	}
  
  	public static long totient(long n) {
  		long result = n;
  		for (int p = 2; p * p <= n; ++p)
  			if (n % p == 0) {
  				while (n % p == 0)
  					n /= p;
  				result -= result / p;
  			}
  		if (n > 1)
  			result -= result / n;
  		return result;
  	}
  
  	int bit(long n) {
  		return (n == 0) ? 0 : (1 + bit(n & (n - 1)));
  	}
  
  	public long max(long... arr) {
  		long max = arr[0];
  		for (long itr : arr)
  			max = Math.max(max, itr);
  		return max;
  	}
  
  	public int max(int... arr) {
  		int max = arr[0];
  		for (int itr : arr)
  			max = Math.max(max, itr);
  		return max;
  	}
  
  	public long min(long... arr) {
  		long min = arr[0];
  		for (long itr : arr)
  			min = Math.min(min, itr);
  		return min;
  	}
  
  	public int min(int... arr) {
  		int min = arr[0];
  		for (int itr : arr)
  			min = Math.min(min, itr);
  		return min;
  	}
  
  	public long sum(long... arr) {
  		long sum = 0;
  		for (long itr : arr)
  			sum += itr;
  		return sum;
  	}
  
  	public long sum(int... arr) {
  		long sum = 0;
  		for (int itr : arr)
  			sum += itr;
  		return sum;
  	}
  
  	void p(Object o) {
  		out.print(o);
  	}
  
  	void pn(Object o) {
  		out.println(o);
  	}
  
  	void pni(Object o) {
  		out.println(o);
  		out.flush();
  	}
  
  	String n() throws Exception {
  		return in.next();
  	}
  
  	String nln() throws Exception {
  		return in.nextLine();
  	}
  
  	int ni() throws Exception {
  		return Integer.parseInt(in.next());
  	}
  
  	long nl() throws Exception {
  		return Long.parseLong(in.next());
  	}
  
  	int[] readArr(int n) throws Exception {
  		int arr[] = new int[n];
  		for (int i = 0; i < n; i++) {
  			arr[i] = ni();
  		}
  		return arr;
  	}
  
  	double nd() throws Exception {
  		return Double.parseDouble(in.next());
  	}
  
  	class FastReader {
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastReader() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
  
  		public FastReader(String s) throws Exception {
  			br = new BufferedReader(new FileReader(s));
  		}
  
  		String next() throws Exception {
  			while (st == null || !st.hasMoreElements()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					throw new Exception(e.toString());
  				}
  			}
  			return st.nextToken();
  		}
  
  		String nextLine() throws Exception {
  			String str = "";
  			try {
  				str = br.readLine();
  			} catch (IOException e) {
  				throw new Exception(e.toString());
  			}
  			return str;
  		}
  	}
  }