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