#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(0);
  cout << fixed;
  long long n;
  cin >> n;
  std::vector<long long> v(n), v2;
  for (long long i = 0; i < n; i++) cin >> v[i];
  bool flag = true;
  v2.push_back(v[n - 1]);
  for (int i = n - 2; i >= 0; i--) {
    for (int j = i + 1; j < n; j++) {
      if (v[j] == v[i]) {
        flag = false;
      }
    }
    if (flag == true) v2.push_back(v[i]);
    flag = true;
  }
  reverse(v2.begin(), v2.end());
  cout << v2.size() << "\n";
  for (int i = 0; i < v2.size(); i++) cout << v2[i] << " ";
}
