def Main(): n=int(input()) for _ in range(n): a=list(map(int,input().split())) b=sorted(a[1:]) print(*b) Main()