#include <bits/stdc++.h>
using namespace std;
bool vf[1001];
int v[51], v2[51];
int main() {
  int n, i, k, cnt = 0, cnt1 = 0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> v[i];
    if (vf[v[i]] == 0) cnt++;
    vf[v[i]] = 1;
  }
  cout << cnt << '\n';
  for (i = n; i >= 1; i--) {
    if (vf[v[i]] == 1) v2[++cnt1] = v[i], vf[v[i]] = 0;
  }
  for (i = cnt1; i >= 1; i--) cout << v2[i] << " ";
  return 0;
}
