m=[] for c in range(int(input())): if not c in m: m.append(input())
This preserves the order but does not add the element if it's already there.