#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp;
  cin >> n;
  int cnt = n;
  bool pin[1001];
  int pin2[n];
  for (int i = 0; i < 1001; i++) pin[i] = 0;
  for (int i = 0; i < n; i++) cin >> pin2[i];
  for (int i = n - 1; i >= 0; i--) {
    if (pin[pin2[i]]) {
      pin2[i] = -1;
      cnt--;
    }
    pin[pin2[i]] = 1;
  }
  cout << cnt << endl;
  for (int i = 0; i < n; i++) {
    if (pin2[i] != -1) cout << pin2[i] << " ";
  }
  return 0;
}
