#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x;
  cin >> n;
  vector<int> v1, v2;
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v1.push_back(x);
    s.insert(x);
  }
  long long int k = s.size();
  int pos;
  for (auto it = s.begin(); it != s.end(); it++) {
    for (int i = 0; i < v1.size(); i++) {
      if (*it == v1[i]) {
        pos = i;
      }
    }
    v2.push_back(pos);
  }
  sort(v2.begin(), v2.end());
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << v1[v2[i]] << " ";
  }
}
