#include <bits/stdc++.h>
int n, a[110], cnt[1010], cnt1[1010], sum;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cnt[a[i]]++;
    if (cnt[a[i]] == 1) sum++;
  }
  printf("%d\n", sum);
  for (int i = 1; i <= n; i++) {
    cnt1[a[i]]++;
    if (cnt1[a[i]] == cnt[a[i]]) printf("%d ", a[i]);
  }
  return 0;
}
