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