#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> v;
  for (int i = 0; i < n - 1; i++) {
    int temp = 1;
    for (int j = i + 1; j < n; j++) {
      if (arr[i] == arr[j]) {
        temp = 0;
        break;
      }
    }
    if (temp) v.push_back(arr[i]);
  }
  v.push_back(arr[n - 1]);
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  return 0;
}
