#include <fstream>
#include <iostream>
#include <stdlib.h>
using namespace std;
int cmp(const void *a, const void *b)
{
	return (*(int*)a - *(int*)b);
}
int main()
{
    ifstream f1("xuathien1lan.inp");
    ofstream f2("xuathien1lan.out");
    int n,a[10000],b[100000],d = 0;
    f1>>n;
    //cin>>n;
    for (int i = 0; i < n; i++)
    {
        f1>>a[i];
        //cin>>a[i];
        if (b[a[i]] < 2) b[a[i]]++;
        if (b[a[i]] == 1) d++;
        if (b[a[i]] == 2) {d--; b[a[i]]++;}
    }
    qsort(a,n,sizeof(int),cmp);
    f2<<d<<endl;
    for (int i = 0; i < n; i++)
    {
        if (b[a[i]] == 1) {f2<<a[i]<<" ";}
    }
    return 0;
}
