for i in range(int(input())): l=list(set(input().split())) l=[int(i)for i in l] l.sort(reverse=1>0) print(*l)