cnt = int(input()) lists = [] for i in range(cnt): inp = list(map(int, input().split())) ans = sorted(set(inp), reverse=True) ans1 = str(" ".join(map(str, ans))) print(ans1) inp.clear()