n = int(input()) for i in range(n): data = np.unique(np.array([int(x) for x in input().split()])) print(np.sort(data))