#include <bits/stdc++.h>
using namespace std;
int a[1005];
int t[1005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    a[t[i]]++;
  }
  int f[1005];
  int b = 0;
  for (int i = n; i >= 1; i--) {
    if (a[t[i]] >= 1) {
      f[b] = t[i];
      b++;
      a[t[i]] = 0;
    }
  }
  cout << b << endl;
  for (int i = b - 1; i >= 0; i--) {
    cout << f[i] << " ";
  }
  return 0;
}
