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