include[HTML_REMOVED]
using namespace std;
int n;
int a[1010];
int main()
{
cin>>n;
for(int i=1;i<=n;i)
{
int x;
cin>>x;
a[x]=1;
}
int ans=0;
for(int i=1;i<=1000;i)
{
if(a[i]==1) ans++;
}
cout<<ans<<endl;
for(int i=1;i<=1000;i++)
{
if(a[i]==1) cout<<i<<" ";
}
return 0;
}