#include <bits/stdc++.h>
using namespace std;
const int _5 = 100005, _6 = 1000006;
int n, a[1001], b[1001];
vector<int> v;
int main() {
  scanf("%d", &n);
  for (int i = 0, b; i < n; ++i) cin >> a[i];
  for (int i = n - 1; i >= 0; --i) {
    if (!b[a[i]]) {
      b[a[i]] = 1;
      v.push_back(a[i]);
    }
  }
  cout << v.size() << endl;
  for (int i = v.size() - 1; i >= 0; --i) {
    cout << v[i] << " ";
  }
  return 0;
}
