#include <bits/stdc++.h>
using namespace std;
int a[52];
int b[52];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  reverse(a, a + n);
  b[0] = a[0];
  int k, c, m;
  c = 1;
  m = 0;
  for (int i = 1; i < n; i++) {
    m = 0;
    k = c;
    for (int j = 0; j < c; j++) {
      if (b[j] == a[i]) {
        break;
      } else
        m++;
    }
    if (m == c) {
      c++;
    }
    if (c != k) {
      b[c - 1] = a[i];
      k = c;
    }
  }
  reverse(b, b + c);
  cout << c << endl;
  for (int i = 0; i < c; i++) cout << b[i] << ' ';
  return 0;
}
