#include<bits/stdc++.h>
using namespace std;
ifstream fi("xuathien1lan.inp");
ofstream fo("xuathien1lan.out");
int main(){
int n,x,a[100001]={0},m,ans=0;
fi>>n;
fi>>m;
a[--m]++;
for(int i=1;i<n;++i){
        fi>>x;
        m=max(m,x);
        a[x-1]++;
}
for(int i=0;i<m;++i)if(a[i]==1)++ans;
fo<<ans<<endl;
for(int i=0;i<m;++i)if(a[i]==1)fo<<i+1<<' ';
}
