#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  int a[n], cnt[1001], ans[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i <= 1000; i++) cnt[i] = 0;
  for (i = n - 1, j = 0; i >= 0; i--) {
    cnt[a[i]]++;
    if (cnt[a[i]] == 1) {
      ans[j] = a[i];
      j++;
    } else
      continue;
  }
  cout << j << endl;
  for (int l = j - 1; l >= 0; l--) {
    cout << ans[l] << " ";
  }
  return 0;
}
