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