#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 2e5 + 6;
const long long inf = 1e15;
long long n;
long long H[1005], a[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("inp.txt", "r", stdin);
    freopen("outp.txt", "w", stdout);
  }
  cin >> n;
  long long i;
  for (i = 1; i <= n; i++) cin >> a[i];
  vector<long long> soln;
  for (i = n; i >= 1; i--) {
    if (!H[a[i]]) {
      soln.push_back(a[i]);
      H[a[i]]++;
    }
  }
  cout << soln.size() << endl;
  for (i = soln.size() - 1; i >= 0; i--) cout << soln[i] << " ";
  return 0;
}
