#include <bits/stdc++.h>
using namespace std;
void Ok() {
  long int a[113], b[1013], c[113], d, e, f, g, h, t, i, j, k, l, m, n, Min,
      Max;
  long int ans_1, ans_2, ans_3, cnt_1, cnt_2, cnt_3, flag_1, flag_2, flag_3,
      temp, sum;
  double aa, bb, cc, dd, ee, ff, gg;
  char aaa, bbb, ccc, ddd;
  string spc, in, store;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(b, 0, sizeof(b));
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  j = 0;
  for (i = n; i >= 1; i--) {
    if (b[a[i]] == 0) b[a[i]] = 1, j++, c[j] = a[i];
  }
  cout << j << endl;
  for (i = j; i >= 1; i--) cout << c[i] << " ";
  return;
}
int main() {
  Ok();
  return 0;
}
