#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 3e5;
const long long BIG = 1e9 + 239;
long long b[51];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n + 1];
  vector<long long> v;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  for (long long i = n; i > 0; i--) {
    if (b[a[i]] > 0) v.push_back(a[i]);
    b[a[i]] = -1;
  }
  cout << v.size() << endl;
  for (long long i = v.size() - 1; i >= 0; i--) cout << v[i] << " ";
  cout << endl;
  return 0;
}
