#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> x;
  x.resize(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  vector<int> colich;
  colich.resize(1000);
  for (int i = 0; i < n; i++) colich[x[i] - 1]++;
  int j = 0;
  while (j < x.size()) {
    if (colich[x[j] - 1] > 1) {
      colich[x[j] - 1]--;
      x.erase(x.begin() + j, x.begin() + j + 1);
    } else {
      j++;
    }
  }
  cout << x.size() << "\n";
  for (int i = 0; i < x.size(); i++) cout << x[i] << " ";
}
