#include <bits/stdc++.h>
using namespace std;
int n;
int ar[2000];
int br[3000];
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    if (br[ar[i]] == 0) {
      ans.push_back(ar[i]);
      br[ar[i]] = 1;
    }
  }
  cout << ans.size() << endl;
  n = ans.size();
  for (int i = 0; i < n; i++) {
    cout << ans[n - i - 1] << " ";
  }
}
