n=int(input())
l1=list(map(int,input().split()))
l2=[]
l3=[]
for i in range(0,1001):
    l2.append(0)
for i in l1:
    l2[i]+=1  #得出l1中所有数的重复次数
for i in l1:
    if l2[i]>1:
        l1.remove(i)
print(len(l1))
l1.sort()
for j in l1:
    print(j)
/**************************************************************
	Problem: 1183
	User: admin
	Language: Python
	Result: Accepted
	Time:99 ms
	Memory:34480 kb
****************************************************************/