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