#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int a[maxn];
int b[maxn];
vector<int> ans;
int main() {
  int n, num = 0;
  memset(a, 0, sizeof a);
  memset(b, 0, sizeof b);
  ans.clear();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = n - 1; i >= 0; i--)
    if (b[a[i]] == 0) ans.push_back(a[i]), b[a[i]] = 1;
  printf("%d\n", ans.size());
  for (int i = ans.size() - 1; i >= 0; i--)
    printf("%d%c", ans[i], i == 0 ? '\n' : ' ');
  return 0;
}
