n = int(input()) ans = [] for i in range(n): temp = list(map(int, input().split())) temp = temp[1:] temp.sort(reverse=True) ans.append(temp) for i in range(n): print(*ans[i])