#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, a = 0, i = 0, t = 0, j = 0;
  cin >> n;
  int s[1010] = {0};
  for (i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (i = 1; i < n; i++) {
    for (j = i - 1; j > -1; j--) {
      if (s[i] == s[j]) {
        s[j] = 0;
      }
    }
  }
  t = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != 0) {
      t++;
    }
  }
  cout << t << endl;
  for (i = 0; i < n; i++) {
    if (s[i] != 0) {
      cout << s[i] << " ";
    }
  }
  return 0;
}
