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