#include <bits/stdc++.h>
using namespace std;
const long long int mod = 3e18 + 7;
const long long int MOD = 1e18 + 7;
const long long int INF = 3e18;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int powm(long long int a, long long int b) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * 1LL * a) % mod;
    b >>= 1LL;
    a = (a * 1LL * a) % mod;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<bool> present(1001, 0);
  vector<int> ans;
  for (int i = n - 1; i >= 0; i--) {
    if (!present[a[i]]) {
      ans.push_back(a[i]);
      present[a[i]] = 1;
    }
  }
  cout << ans.size() << '\n';
  for (int i = ans.size() - 1; i >= 0; i--) cout << ans[i] << " ";
  return 0;
}
