#include using namespace std; int main() { int n; cin >> n; unordered_set hash; deque res; while (n--) { int x; cin >> x; if (hash.find(x) == hash.end()) { res.push_back(x); hash.insert(x); } } cout << res.size() << '\n'; while (!res.empty()) { cout << res.front() << " "; res.pop_front(); } cout << '\n'; }