#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const long long M = 1e9 + 7;
map<long long, long long> m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, a[1000];
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  cout << m.size() << endl;
  for (long long i = 0; i < n; i++) {
    if (m[a[i]] == 1) {
      cout << a[i] << " ";
    } else
      m[a[i]]--;
  }
}
