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