#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  set<int> s;
  int b[100], p = 0;
  for (int i = n; i >= 1; i--) {
    int x = s.size();
    s.insert(a[i]);
    if (s.size() != x) {
      p++;
      b[p] = a[i];
    }
  }
  cout << p << endl;
  for (int i = p; i >= 1; i--) cout << b[i] << ' ';
  return 0;
}
