#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  list<int> s;
  list<int>::iterator it;
  int temp;
  while (n--) {
    cin >> temp;
    s.remove(temp);
    s.push_back(temp);
  }
  cout << s.size() << endl;
  for (it = s.begin(); it != s.end(); ++it) {
    cout << *it << " ";
  }
}
