#include <bits/stdc++.h>
using namespace std;
int f[1005], v[53];
int main() {
  int n, x, i, sol1 = 0, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> v[i];
    f[v[i]]++;
    if (f[v[i]] == 1) sol1++;
  }
  cout << sol1 << "\n";
  for (i = 0; i < n; i++) {
    f[v[i]]--;
    if (f[v[i]] == 0) cout << v[i] << " ";
  }
  return 0;
}
