N = int(input().strip()) lst = [] for i in range(N): LINE = list(map(int, input().strip().split(' '))) K = LINE[0] lst.append(' '.join([str(i) for i in sorted(LINE[1:], reverse=True)])) for i in lst: print(i)