#include <bits/stdc++.h>
using namespace std;
int a[11000], c[1100], ans[1100];
int main() {
  int n, size = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = n; i >= 1; i--) {
    if (!c[a[i]]) {
      c[a[i]]++;
      ans[++size] = a[i];
    }
  }
  cout << size << endl;
  for (int i = size; i >= 1; i--) {
    cout << ans[i] << " ";
  }
}
