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