You are given an integer n and an array a_1, a_2, …, a_n. You should reorder the elements of the array a in such way that the sum of MEX on prefixes (i-th prefix is a_1, a_2, …, a_i) is maximized.

Formally, you should find an array b_1, b_2, …, b_n, such that the sets of elements of arrays a and b are equal (it is equivalent to array b can be found as an array a with some reordering of its elements) and ∑_{i=1}^{n} MEX(b_1, b_2, …, b_i) is maximized.

MEX of a set of nonnegative integers is the minimal nonnegative integer such that it is not in the set.

For example, MEX(\{1, 2, 3\}) = 0, MEX(\{0, 1, 2, 4, 5\}) = 3.

Input

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

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

The second line of each test case contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 100).

Output

For each test case print an array b_1, b_2, …, b_n — the optimal reordering of a_1, a_2, …, a_n, so the sum of MEX on its prefixes is maximized.

If there exist multiple optimal answers you can find any.

Example

Input


3
7
4 2 0 1 3 3 7
5
2 2 8 6 9
1
0


Output


0 1 2 3 4 7 3 
2 6 8 9 2 
0 

Note

In the first test case in the answer MEX for prefixes will be: 

  1. MEX(\{0\}) = 1 
  2. MEX(\{0, 1\}) = 2 
  3. MEX(\{0, 1, 2\}) = 3 
  4. MEX(\{0, 1, 2, 3\}) = 4 
  5. MEX(\{0, 1, 2, 3, 4\}) = 5 
  6. MEX(\{0, 1, 2, 3, 4, 7\}) = 5 
  7. MEX(\{0, 1, 2, 3, 4, 7, 3\}) = 5 

The sum of MEX = 1 + 2 + 3 + 4 + 5 + 5 + 5 = 25. It can be proven, that it is a maximum possible sum of MEX on prefixes.
import java.io.*;
import java.util.*;
import java.math.BigInteger; 

public class test1 {
    
    
   static class sort implements Comparator<int[]>
   {
        public int compare(int[] a,int[] b)
        {
            //if(a[0] == b[0]) return a[1]-b[1];
           return a[0]-b[0];
        }
   }
   public static void pr(PrintWriter out,Object o)
   {
      
    out.println(o.toString());out.flush();
    
   }
   public static void prW(PrintWriter out,Object o)
   {
      
    out.print(o.toString());out.flush();
    
   }
   public static int intIn(String st)
   {
      return Integer.parseInt(st);
   }
   
   
    
    public static void pr(Object o)
    {
        System.out.println(o.toString());
    }
    public static void prW(Object o)
    {
        System.out.print(o.toString());
    }
    
   
    public static int inInt(String s)
    {
        return Integer.parseInt(s);
    }
    public static long in(String s)
    {
        return Long.parseLong(s);
    }

    
    
    static int[] toIntArray(String[] m) 
    { 
        int[] p=new int[m.length];
        for(int o=0;o<m.length;o++)
        {
            p[o]= inInt(m[o]);
        }
        return p;
    }
    static long[] toLArray(String[] m) 
    { 
       long[] p=new long[m.length];
        for(int o=0;o<m.length;o++)
        {
            p[o]= in(m[o]);
        }
        return p;
    }
    static long max=10000000000000l;static int[] before;static int R;
    
    public static String[] F(BufferedReader bf) throws Exception
    {
        return (bf.readLine().split(" "));
    }
    static long res=0l;
    public static int F(int i,int p,Integer[][] dp,char[] a,char[] b)
    {
       if(i>=a.length)
       {
          if(p==0) return 0;return -100000000;
       }

       if(dp[i][p] != null)  return dp[i][p];
       int res=0;
       if(a[i] == b[i])
       {
            if(p>0) res = F(i+1,p-1,dp,a,b)+1;
            res=Math.max(res,F(i+1,p,dp,a,b));
       }
       else
       {
            if(p>0) res = F(i+1,p-1,dp,a,b);
            res=Math.max(res,F(i+1,p,dp,a,b)+1);
       
       }

       dp[i][p]=res;return res;

    }
    public static int F(int i,int p,int u,Integer[][][] dp,char[] a,char[] b,char[] c)
    {
       if(i>=a.length)
       {
          if(p==0 && u==0) return 0;return -100000000;
       }

       if(dp[i][p][u] != null)  return dp[i][p][u];
       int res=0;
       if(a[i] == b[i] && b[i]==c[i])
       {
            if(p>0 && u>0) res = F(i+1,p-1,u-1,dp,a,b,c)+1;
            res=Math.max(res,F(i+1,p,u,dp,a,b,c));
       }
       else if(a[i]==c[i])
       {
            if(p>0) res = F(i+1,p-1,u,dp,a,b,c)+1;
            if(u>0)
            res=Math.max(res,F(i+1,p,u-1,dp,a,b,c));
       }
       else if(b[i]==c[i])
       {
            if(u>0) res = F(i+1,p,u-1,dp,a,b,c)+1;
            if(p>0)
            res=Math.max(res,F(i+1,p-1,u,dp,a,b,c));
       }
       else if(a[i]==b[i])
       {
            if(p>0 && u>0) res = F(i+1,p-1,u-1,dp,a,b,c);
            res=Math.max(res,F(i+1,p,u,dp,a,b,c)+1);
       }

       dp[i][p][u]=res;return res;

    }
    
    
    public static void main (String[] args) throws Exception {
        
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        //PrintWriter out = new PrintWriter(System.out);;;
        
        //int[] map=new int[1000001];
      
        int y=Integer.parseInt(bf.readLine());
        
        for(int w=0;w<y;w++)
        {

            
            
            String[] xlp = bf.readLine().split(" ");;;
            
            int n,k,t,h;//boolean bol=false;
           int m;long a,b,c;
            n=inInt(xlp[0]);//m=in(xlp[1]);//k=inInt(xlp[2]);//t=inInt(xlp[3]);
            int[] arr = toIntArray(F(bf));
            int[] count = new int[101];
            
            for(int x : arr) count[x]++;
            for(int o=0;o<count.length;o++)
            {
                if(count[o] >0)
                {
                    prW(o+" ");
                    count[o]--;
                }
            }
             for(int o=0;o<count.length;o++)
            {
                while(count[o] >0)
                {
                    prW(o+" ");
                    count[o]--;
                }
            }
            pr("");

            
            
        }
        //out.close();

    }
}


/*
1
8
13 13 9 12 13 1 13 1

1
5
8 4 7 -2 
1 2
1 3
3 4 
4 5



100663319,201326611,402653189,805306457,1610612741
Kickstart
String rp;
            rp = "Case #"+(w+1)+": "+(n-ans)+" ";
            if(curr == max) rp=rp +"INDEFINITELY";
            else rp = rp+(curr);
static int[][] dir={{0,1},{1,0},{-1,0},{0,-1}};

static class SegmentTreeRMQ 
    { 
    int st[]; 
    int minVal(int x, int y) { 
        return (x > y) ? x : y; 
    } 
  
    
    int getMid(int s, int e) { 
        return s + (e - s) / 2; 
    } 
  
    
    int RMQUtil(int ss, int se, int qs, int qe, int index) 
    { 
        
        if (qs <= ss && qe >= se) 
            return st[index]; 
  
        // If segment of this node is outside the given range 
        if (se < qs || ss > qe) 
            return Integer.MIN_VALUE; 
  
        // If a part of this segment overlaps with the given range 
        int mid = getMid(ss, se); 
        return minVal(RMQUtil(ss, mid, qs, qe, 2 * index + 1), 
                RMQUtil(mid + 1, se, qs, qe, 2 * index + 2)); 
    } 
  
    // Return minimum of elements in range from index qs (query 
    // start) to qe (query end).  It mainly uses RMQUtil() 
    int RMQ(int n, int qs, int qe) 
    { 
        // Check for erroneous input values 
        
  
        return RMQUtil(0, n - 1, qs, qe, 0); 
    } 
  
    // A recursive function that constructs Segment Tree for 
    // array[ss..se]. si is index of current node in segment tree st 
    int constructSTUtil(int arr[], int ss, int se, int si) 
    { 
        // If there is one element in array, store it in current 
        //  node of segment tree and return 
        if (ss == se) { 
            st[si] = arr[ss]; 
            return arr[ss]; 
        } 
  
        // If there are more than one elements, then recur for left and 
        // right subtrees and store the minimum of two values in this node 
        int mid = getMid(ss, se); 
        st[si] = minVal(constructSTUtil(arr, ss, mid, si * 2 + 1), 
                constructSTUtil(arr, mid + 1, se, si * 2 + 2)); 
        return st[si]; 
    } 
  
    
    void con(int arr[]) 
    { 
        // Allocate memory for segment tree 
  
        //Height of segment tree 
        int n = (arr.length);
        int x = (int) (Math.ceil(Math.log(n) / Math.log(2))); 
  
        //Maximum size of segment tree 
        int max_size = 2 * (int) Math.pow(2, x) - 1; 
        st = new int[max_size]; // allocate memory 
  
        // Fill the allocated memory st 
        constructSTUtil(arr, 0, n - 1, 0); 
    }
    }
     static class DSU {
    
    int[] p;int[] sz;int op;int c;;
    int[] last;
    public void G(int n)
    {
        last=new int[n];
        p=new int[n];
        sz=new int[n];c=n;
        op=n;
        for(int h=0;h<n;h++)
        {
            sz[h]=1;p[h]=h;
            last[h]=h;
        }
    }
    public int find(int x)
    {
        int y=x;
        while(x!=p[x]) x=p[x];
        while(y!=p[y])
        {
            int tem=p[y];
            p[y]=x;y=tem;
        }
        return p[y];
    }
    public void union(int a,int b)
    {
        int x,y;
        x=find(a);y=find(b);
        if(x==y) return;
        if(sz[x]>sz[y])
        {
            p[y] = x;
            sz[x]+=sz[y];
            last[x]=Math.max(last[x],last[y]);
        }
        else
        {
            p[x]=y;sz[y]+=sz[x];
            last[y]=Math.max(last[y],last[x]);
        }
        c--;
        
    }}

    static long pow(long x, long y, long p)
      {
        long res = 1; // Initialize result
     
        x = x % p; // Update x if it is more than or
        // equal to p
     
        if (x == 0)
          return 0l; // In case x is divisible by p;
     
        while (y > 0)
        {
     
          // If y is odd, multiply x with result
          if ((y & 1) != 0)
            res = (res * x) % p;
     
          // y must be even now
          y = y >> 1; // y = y/2
          x = (x * x) % p;
        }
        return res;
      }
      static long gcd(long a, long b)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b); 
        }
        static int gcd(int a, int b,int o)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b,o); 
        }
    
      
    

*/


