#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int valid[1001] = {0};
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    v.push_back(num);
  }
  vector<int> arr;
  for (int i = n - 1; i >= 0; i--) {
    if (valid[v[i]] == 0) {
      arr.push_back(v[i]);
      valid[v[i]] = 1;
    } else
      continue;
  }
  cout << arr.size() << '\n';
  for (int i = arr.size() - 1; i >= 0; i--) {
    cout << arr[i];
    if (i != 0) cout << " ";
  }
  cout << '\n';
  return 0;
}
