#include <bits/stdc++.h>
using namespace std;
int n, a[60], b[60], x = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) {
    bool k = true;
    for (int j = 0; j < x; j++)
      if (a[i] == b[j]) k = false;
    if (k == true) {
      b[x] = a[i];
      x++;
    }
  }
  cout << x << endl;
  for (int i = x - 1; i >= 0; i--) cout << b[i] << ' ';
}
