#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i;
  cin >> n;
  int vis[1005];
  memset(vis, -1, sizeof(vis));
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    vis[a[i]] = 0;
  }
  for (i = n - 1; i >= 0; i--) {
    if (vis[a[i]])
      a[i] = 0;
    else if (!vis[a[i]]) {
      vis[a[i]] = 1;
    }
  }
  int count = 0;
  for (i = 0; i < n; i++) {
    if (a[i]) count++;
  }
  cout << count << endl;
  for (i = 0; i < n; i++) {
    if (a[i]) {
      cout << a[i] << " ";
    }
  }
  cout << endl;
  return 0;
}
