#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  for (int i = v.size() - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      if (v[j] == v[i]) v[j] = -1;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] != -1) ans++;
  }
  cout << ans << endl;
  for (int i = 0; i < n; i++) {
    if (v[i] != -1) cout << v[i] << " ";
  }
  cout << endl;
  return 0;
}
