#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int arr[maxn];
map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> v;
  for (int i = n - 1; i >= 0; i--) {
    if (mp[arr[i]] == 0) {
      mp[arr[i]] = 1;
      v.push_back(arr[i]);
    }
  }
  reverse(v.begin(), v.end());
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
