#include <iostream>
#include <unordered_set>
#include <algorithm>
using namespace std;
int main() {
int N;
unordered_set<int> set;
int a[1117];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> a[i];
set.insert(a[i]);
}
size_t size = set.size();
cout << size << endl;
int* array = new int[size];
size_t index = 0;
for (const auto& element : set) {
array[index++] = element;
}
sort(array, array + size);
for (int i = 0; i < size; i++) {
cout << array[i] << ' ';
}
delete[] array;
return 0;
}