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