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 range(len(parts)):
		if j != len(parts)-1:
			print(parts[j], end=" ")
		else:
			print(parts[j])