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: //package Codeforces.PractiseR1000;
  
  
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.*;
  
  public class AbsentReminder {
      public static void main(String[] args) throws Exception {new AbsentReminder().run();}
      long mod = 1000000000 + 7;
  
      int ans=0;
      // int[][] ar;
      void solve() throws Exception {
  
          int t=ni();
          while(t-->0){
              int n = ni();
              //long h = nl();
              int[] a = new int[n];
              for(int i=0;i<n;i++){
                  a[i] = ni();
  
              }
              int k = n/2;
              int min = Integer.MAX_VALUE;
              for(int i:a){
                  min = Math.min(i,min);
              }
             // Set<Integer> set = new HashSet<>();
              List<int[]> l = new ArrayList<>();
             // for(int i:a) set.add(i);
              boolean flag=false;
  
              for(int i=0;i<n;i++){
                  if(a[i]!=min)
                  l.add(new int[]{a[i],min});
                  if(l.size()==k) break;
              }
  
              for(int[] tmp:l){
                  out.println(tmp[0]+" "+tmp[1]);
              }
          }
      }
  
      long helper(int[] a,long mid){
  
          long res=0;
          int n =a.length;
          for(int i=1;i<n;i++){
  
              if(a[i]-a[i-1]>=mid) res+=mid;
              else res+=(a[i]-a[i-1]);
          }
          res+=mid;
          return res;
  
      }
  
  
  
      // void buildMatrix(){
      //
      // for(int i=1;i<=1000;i++){
      //
      // ar[i][1] = (i*(i+1))/2;
      //
      // for(int j=2;j<=1000;j++){
      // ar[i][j] = ar[i][j-1]+(j-1)+i-1;
      // }
      // }
      // }
  
      /* FAST INPUT OUTPUT & METHODS BELOW */
  
      private byte[] buf = new byte[1024];
      private int index;
      private InputStream in;
      private int total;
      private SpaceCharFilter filter;
      PrintWriter out;
  
      int min(int... ar) {
          int min = Integer.MAX_VALUE;
          for (int i : ar)
              min = Math.min(min, i);
          return min;
      }
  
      long min(long... ar) {
          long min = Long.MAX_VALUE;
          for (long i : ar)
              min = Math.min(min, i);
          return min;
      }
  
      int max(int... ar) {
          int max = Integer.MIN_VALUE;
          for (int i : ar)
              max = Math.max(max, i);
          return max;
      }
  
      long max(long... ar) {
          long max = Long.MIN_VALUE;
          for (long i : ar)
              max = Math.max(max, i);
          return max;
      }
  
      void shuffle(int a[]) {
          ArrayList<Integer> al = new ArrayList<>();
          for (int i = 0; i < a.length; i++)
              al.add(a[i]);
  
          Collections.sort(al);
          for (int i = 0; i < a.length; i++)
              a[i] = al.get(i);
      }
  
      long lcm(long a, long b) {
          return (a * b) / (gcd(a, b));
      }
  
      int gcd(int a, int b) {
          if (a == 0)
              return b;
          return gcd(b % a, a);
      }
  
      long gcd(long a, long b) {
          if (a == 0)
              return b;
          return gcd(b % a, a);
      }
  
      /*
       * for (1/a)%mod = ( a^(mod-2) )%mod ----> use expo to calc -->(a^(mod-2))
       */
      long expo(long p, long q) /* (p^q)%mod */
      {
          long z = 1;
          while (q > 0) {
              if (q % 2 == 1) {
                  z = (z * p) % mod;
              }
              p = (p * p) % mod;
              q >>= 1;
          }
          return z;
      }
  
      void run() throws Exception {
          in = System.in;
          out = new PrintWriter(System.out);
          solve();
          out.flush();
      }
  
      private int scan() throws IOException {
          if (total < 0)
              throw new InputMismatchException();
          if (index >= total) {
              index = 0;
              total = in.read(buf);
              if (total <= 0)
                  return -1;
          }
          return buf[index++];
      }
  
      private int ni() throws IOException {
          int c = scan();
          while (isSpaceChar(c))
              c = scan();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = scan();
          }
          int res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = scan();
          } while (!isSpaceChar(c));
          return res * sgn;
      }
  
      private long nl() throws IOException {
          long num = 0;
          int b;
          boolean minus = false;
          while ((b = scan()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
              ;
          if (b == '-') {
              minus = true;
              b = scan();
          }
  
          while (true) {
              if (b >= '0' && b <= '9') {
                  num = num * 10 + (b - '0');
              } else {
                  return minus ? -num : num;
              }
              b = scan();
          }
      }
  
      private double nd() throws IOException {
          return Double.parseDouble(ns());
      }
  
      private String ns() throws IOException {
          int c = scan();
          while (isSpaceChar(c))
              c = scan();
          StringBuilder res = new StringBuilder();
          do {
              if (Character.isValidCodePoint(c))
                  res.appendCodePoint(c);
              c = scan();
          } while (!isSpaceChar(c));
          return res.toString();
      }
  
      private String nss() throws IOException {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          return br.readLine();
      }
  
      private char nc() throws IOException {
          int c = scan();
          while (isSpaceChar(c))
              c = scan();
          return (char) c;
      }
  
      private boolean isWhiteSpace(int n) {
          if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
              return true;
          return false;
      }
  
      private boolean isSpaceChar(int c) {
          if (filter != null)
              return filter.isSpaceChar(c);
          return isWhiteSpace(c);
      }
  
      private interface SpaceCharFilter {
          public boolean isSpaceChar(int ch);
      }
  }
  