#include <bits/stdc++.h>
using namespace std;
bool cnt[1050];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int ara[n + 20], cntt = 0;
  vector<int> v;
  for (int i = 1; i <= n; i++) cin >> ara[i];
  for (int i = n; i >= 1; i--) {
    if (cnt[ara[i]] == 0) {
      cntt++;
      cnt[ara[i]] = 1;
      v.push_back(ara[i]);
    }
  }
  cout << cntt << endl;
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
