#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  vector<int> s1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) {
    auto it = find(s1.begin(), s1.end(), a[i]);
    if (it == s1.end()) s1.push_back(a[i]);
  }
  cout << s1.size() << endl;
  for (int i = s1.size() - 1; i >= 0; i--) cout << s1[i] << " ";
  return 0;
}
