#include<iostream>
#include<map>
using namespace std;
map<int,int> hs;
int main(){
int n;
cin>>n;
while(n--){
int x;
cin>>x;
hs[x]++;
}
cout<<hs.size()<<endl;
for(auto x:hs)
cout<<x.first<<' ';
return 0;
}