N = int(input()) ans = [] for _ in range(N): L = list(map(int,input().split())) ans.append(L[1:]) for i in range(N): ans[i].sort(reverse=True) print(' '.join(map(str,ans[i])))