n = int(input()) for i in range(n): L = list(set(map(int,input().split()))) L.sort(reverse=True) print(" ".join([str(i) for i in L]))