#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[1000], b[1000] = {-1000000000}, n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int g = 0;
  for (int i = n - 1; i > -1; i--) {
    int j = 0;
    for (j = 0; j < g + 1; j++)
      if (a[i] == b[j]) break;
    if (j == g + 1) {
      b[g] = a[i];
      g++;
    }
  }
  cout << g << endl;
  for (int i = g - 1; i > -1; i--) cout << b[i] << " ";
}
