def main (): N = int(input()) for i in range (N): KL = list(map(int, input().split())) L = set(KL) gear = sorted(L, reverse=True) print(*gear) if __name__ == '__main__': main()