n = int(input()) for i in range(n): parts = input().split() map(int, parts) a = parts[0] del parts[0] parts.sort() for j in parts: print(j, end=" ") if i != n-1: print()