clocks_num = int(input()) def sort_parts(): a_clo = list(map(int,input().split()[1:])) list.sort(a_clo, reverse=True) return a_clo for i in range(clocks_num): print(" ".join([str(i) for i in sort_parts()]))