n = int(input()) for i in range(n): parts = input().split() map(int, parts) a = parts[0] del parts[0] parts.sort(reverse=True) for j in parts: if j != parts[-1]: print(j, end=" ") else: print(j)