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.io.*;
  import java.util.*;
  
  
  public class CodeForces{
      /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/
  
      public static void main(String[] args) throws IOException{
          openIO();
          int testCase = 1;
          testCase = sc.nextInt();
          preCompute();
          for (int i = 1; i <= testCase; i++) solve(i);
          closeIO();
      }
      public static void solve(int tCase)throws IOException {
          int n= sc.nextInt();
          int min  = inf_int;
          int[] arr = new int[n];
          for(int i=0;i<n;i++){
              arr[i] = sc.nextInt();
              min = Math.min(arr[i],min);
          }
          int cnt = 0;
          for(int i=0;i<n && cnt < n/2;i++){
              if(min  == arr[i])continue;
              out.println(arr[i] +" " +min);
              cnt++;
          }
      
  
      }
  
  
     
      private static void  preCompute(){}
      /*-------------------------------------------EDITING CODE ENDS HERE-------------------------------------------*/
      static FastestReader sc;
      static PrintWriter out;
      private static void openIO() throws IOException{
          sc = new FastestReader();
          out = new PrintWriter(System.out);
      }
  
      /*------------------------------------------HELPER FUNCTION STARTS HERE------------------------------------------*/
  
      public static final int mod = (int) 1e9 +7;
      private static final int mod2 =  998244353;
      public static final int inf_int = (int) 2e9 + 10;
      public static  final long inf_long = (long) 4e18;
  
  
      public static int _digitCount(long num,int base){
          return (int)(1 + Math.log(num)/Math.log(base));
      }
      // time : O(r)
      public static int _ncr(int n,int r){
          if (r > n) return 0;
          long[]  inv = new long[r + 1];
          inv[0] = 1;
          if(r+1>=2)
              inv[1] = 1;
  
          // Getting the modular inversion
          // for all the numbers
          // from 2 to r with respect to mod
          for (int i = 2; i <= r; i++)
              inv[i] = mod - (mod / i) * inv[(mod % i)] % mod;
  
          int ans = 1;
  
          // for 1/(r!) part
          for (int i = 2; i <= r; i++)
              ans = (int) (((ans % mod) * (inv[i] % mod)) % mod);
  
          // for (n)*(n-1)*(n-2)*...*(n-r+1) part
          for (int i = n; i >= (n - r + 1); i--)
              ans =  (((ans % mod) * (i % mod)) % mod);
          return ans;
      }
  
      // euclidean algorithm time O(max (loga ,logb))
      public static long _gcd(long a, long b) {
          if (a == 0)
              return b;
          return _gcd(b % a, a);
      }
  
      public static long _lcm(long a, long b) {
          // lcm(a,b) * gcd(a,b) = a * b
          return (a / _gcd(a, b)) * b;
      }
  
  
      // binary exponentiation time O(logn)
      public static long _power(long x, long n) {
          long ans = 1;
          while (n > 0) {
              if ((n & 1) == 1) {
                  ans *= x;
                  ans %= mod;
                  n--;
              } else {
                  x *= x;
                  x %= mod;
                  n >>= 1;
              }
          }
          return ans;
      }
      //sieve/first divisor time : O(mx * log ( log (mx) ) )
      public static int[]  _seive(int mx){
          int[] firstDivisor = new int[mx+1];
          for(int i=0;i<=mx;i++)firstDivisor[i] = i;
          for(int i=2;i*i<=mx;i++)
              if(firstDivisor[i] == i)
                  for(int j = i*i;j<=mx;j+=i)
                      firstDivisor[j] = i;
          return firstDivisor;
      }
  
      private static boolean _isPrime(long x){
          for(long i=2;i*i<=x;i++)
              if(x%i==0)return false;
          return true;
      }
  
      public static void _sort(int[] arr,boolean isAscending){
          int n = arr.length;
          List<Integer> list = new ArrayList<>();
          for(int ele : arr)list.add(ele);
          Collections.sort(list);
          if(!isAscending)Collections.reverse(list);
          for(int i=0;i<n;i++)arr[i] = list.get(i);
      }
  
      public static void _sort(long[] arr,boolean isAscending){
          int n = arr.length;
          List<Long> list = new ArrayList<>();
          for(long ele : arr)list.add(ele);
          Collections.sort(list);
          if(!isAscending)Collections.reverse(list);
          for(int i=0;i<n;i++)arr[i] = list.get(i);
      }
      /*------------------------------------------HELPER FUNCTION ENDS HERE-------------------------------------------*/
  
      /*-------------------------------------------FAST INPUT STARTS HERE---------------------------------------------*/
  
      public static void closeIO() throws IOException{
          out.flush();
          out.close();
          sc.close();
      }
      private static final class FastestReader {
          private static final int BUFFER_SIZE = 1 << 16;
          private final DataInputStream din;
          private final byte[] buffer;
          private int bufferPointer, bytesRead;
  
          public FastestReader() {
              din = new DataInputStream(System.in);
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public FastestReader(String file_name) throws IOException {
              din = new DataInputStream(new FileInputStream(file_name));
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
  
          private int skip() throws IOException {
              int b;
              //noinspection StatementWithEmptyBody
              while ((b = read()) != -1 && isSpaceChar(b)) {}
              return b;
          }
  
          public String next() throws IOException {
              int b = skip();
              final StringBuilder sb = new StringBuilder();
              while (!isSpaceChar(b)) { // when nextLine, (isSpaceChar(b) && b != ' ')
                  sb.appendCodePoint(b);
                  b = read();
              }
              return sb.toString();
          }
  
          public int nextInt() throws IOException {
              int ret = 0;
              byte c = read();
              while (c <= ' ') {
                  c = read();
              }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (neg) { return -ret; }
              return ret;
          }
  
          public long nextLong() throws IOException {
              long ret = 0;
              byte c = read();
              while (c <= ' ') { c = read(); }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
              if (neg) { return -ret; }
              return ret;
          }
  
          public double nextDouble() throws IOException {
              double ret = 0, div = 1;
              byte c = read();
              while (c <= ' ') { c = read(); }
              final boolean neg = c == '-';
              if (neg) { c = read(); }
  
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (c == '.') {
                  while ((c = read()) >= '0' && c <= '9') {
                      ret += (c - '0') / (div *= 10);
                  }
              }
  
              if (neg) { return -ret; }
              return ret;
          }
  
          private void fillBuffer() throws IOException {
              bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
              if (bytesRead == -1) { buffer[0] = -1; }
          }
  
          private byte read() throws IOException {
              if (bufferPointer == bytesRead) { fillBuffer(); }
              return buffer[bufferPointer++];
          }
  
          public void close() throws IOException {
              din.close();
          }
      }
      /*---------------------------------------------FAST INPUT ENDS HERE ---------------------------------------------*/
  }