#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  bool flag[1050];
  memset(flag, false, sizeof(flag));
  vector<int> ans;
  for (int i = n - 1; i >= 0; i--) {
    if (!flag[arr[i]]) {
      flag[arr[i]] = true;
      ans.push_back(arr[i]);
    }
  }
  cout << ans.size() << endl;
  for (int i = ans.size() - 1; i >= 0; i--) {
    if (i > 0) {
      cout << ans[i] << " ";
    } else {
      cout << ans[i] << "\n";
    }
  }
}
