#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int cnt = 0;
  std::vector<int> v;
  for (int i = n - 1; i > 0; --i) {
    if (a[i] != 10000) {
      for (int j = i - 1; j >= 0; --j) {
        if (a[j] == a[i]) {
          a[j] = 10000;
        }
      }
      v.push_back(a[i]);
    }
  }
  if (a[0] != 10000) {
    v.push_back(a[0]);
  }
  cout << v.size() << endl;
  for (int i = v.size() - 1; i >= 0; --i) {
    cout << v[i] << ' ';
  }
  cout << endl;
  return 0;
}
