#include <bits/stdc++.h>
using namespace std;
int pos[1005];
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  fill(pos, pos + 1005, -1);
  vector<int> v;
  for (int i = n - 1; i >= 0; --i) {
    if (pos[a[i]] == -1) {
      v.push_back(a[i]);
      pos[a[i]] = i;
    }
  }
  cout << v.size() << "\n";
  for (int i = v.size() - 1; i >= 0; --i) {
    cout << v[i] << " ";
  }
  return 0;
}
