#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    m[d] = i;
  }
  vector<pair<int, int> > v;
  for (auto a = m.begin(); a != m.end(); a++) {
    v.push_back({a->second, a->first});
  }
  sort(v.begin(), v.end());
  const int size = v.size();
  cout << size << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].second << " ";
  }
  return 0;
}
