#include <bits/stdc++.h>
using namespace std;
int nx[] = {1, -1, 0, 0};
int ny[] = {0, 0, -1, 1};
long long r, c;
bool check(long long xx, long long yy) {
  return (xx >= 1 and xx <= r and yy >= 1 and yy <= c);
}
bool boundary(long long xx, long long yy) {
  return (xx == 1 or xx == r or yy == 1 or yy == c);
}
int main() {
  long long n;
  long long x;
  scanf("%lld", &n);
  long long a[n + 10];
  bool arr[1000];
  memset(arr, false, sizeof arr);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  vector<long long> v;
  for (long long i = n; i >= 1; i--) {
    if (arr[i] == false) {
      v.push_back(a[i]);
    }
    for (long long j = i - 1; j >= 1; j--) {
      if (a[i] == a[j]) {
        arr[j] = true;
      }
    }
  }
  cout << v.size() << endl;
  for (long long i = v.size() - 1; i >= 0; i--) {
    cout << v[i] << " ";
  }
  return 0;
}
