#include <bits/stdc++.h>
using namespace std;
void merge(vector<int> &v, int l, int m, int r){
int c = (m-l)+1;
int d = r - m;
vector<int>a(c);
for (int i = 0; i<c; i++){
a[i] = v[l+i];
}
vector<int>b(d);
for (int i=0; i<d; i++){
b[i] = v[m+1+i];
}
int x=l, i=0, j=0;
while (i<c && j<d){
if (a[i]<b[j]){
v[x] = a[i];
i++;
}else{
v[x] = b[j];
j++;
}
x++;
}
while (i<c){
v[x] = a[i];
x++;
i++;
}
while (j<d){
v[x] = b[j];
x++;
j++;
}
}
void merge_sort(vector<int> &v, int l, int r){
if (l<r){
int m = l + (r-l)/2;
merge_sort(v, l, m);
merge_sort(v, m+1, r);
merge(v, l, m ,r);
}
}
void print(vector<int> v){
for (int i=0; i<v.size(); i++){
cout<<v[i]<<" ";
}
}
int main() {
//freopen("ip.txt","r",stdin);
//freopen("op.txt","w",stdout);
int t;
cin>>t;
while (t--){
int x;
cin>>x;
vector<int>v(x);
for (int i=0; i<x; i++){
cin>>v[i];
}
merge_sort (v,0,x-1);
print (v);
cout<<endl;
}
return 0;
}