#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m[1010];
bool m1[1010];
cin>>n;
for(int i = 0; i<n; i++) cin>>m[i];
for(int i = 0; i<n; i++) m1[i]=1;
sort(m,m+n);
for(int i = 0; i<n; i++)
for(int o = 0; o<n; o++)
if(m[i]==m[o]) {n--; m1[i]=0;}
cout<<n<<endl;
for(int i = 0; i<n; i++)
if(m1[i])cout << m[i] << " ";
return 0;
}