#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<int> ans;
  bool us[1001] = {false};
  for (int i = n - 1; i >= 0; i--) {
    if (!us[a[i]]) {
      us[a[i]] = true;
      ans.push_back(a[i]);
    }
  }
  reverse(ans.begin(), ans.end());
  cout << ans.size() << '\n';
  for (int i : ans) cout << i << ' ';
}
