#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
vector<int> vec1;
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    vec.push_back(x);
  }
  for (int i = n - 1, x; i >= 0; i--) {
    if (count(vec1.begin(), vec1.end(), vec[i]) > 0) {
      continue;
    } else {
      vec1.push_back(vec[i]);
    }
  }
  reverse(vec1.begin(), vec1.end());
  cout << vec1.size() << endl;
  for (int i = 0; i < vec1.size(); i++) {
    cout << vec1[i] << " ";
  }
  cout << endl;
  return 0;
}
