#include <bits/stdc++.h>
int main() {
  int n, i, j, k = 0, p;
  scanf("%d", &n);
  int a[n], b[n];
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = n - 1; i >= 0; i--) {
    j = i + 1;
    p = 1;
    while (j <= n - 1) {
      if (a[i] == a[j]) {
        p = -1;
        break;
      }
      j++;
    }
    if (p == 1) {
      b[k] = a[i];
      k++;
    }
  }
  printf("%d\n", k);
  for (j = k - 1; j >= 0; j--) printf("%d ", b[j]);
  printf("\n");
}
