文件目录

#include <bits/stdc++.h>
using namespace std;
set<int> s;
int main()
{
    int n, a;
    cin >> n;
    while (n--)
    {
        cin >> a;
        s.insert(a);
    }
    cout << s.size() << endl;
    for (auto i = s.begin(); i != s.end(); i++)
        cout << *i << " ";
    return 0;
}