#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> num(n);
  vector<bool> sl(1000, false);
  vector<int> sna;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (sl[num[i]] == false) {
      sna.push_back(num[i]);
      sl[num[i]] = true;
    }
  }
  reverse(sna.begin(), sna.end());
  cout << sna.size() << endl;
  for (int i = 0; i < sna.size(); i++) {
    cout << sna[i] << " ";
  }
}
