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