def main (): N = int(input()) for i in range (N): KL = list(map(int, input().split())) L = KL[1:] L = sorted(L,reverse=True) print(L) if __name__ == '__main__': main()