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