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