#include <bits/stdc++.h>
using namespace std;
long long power_of(long long k, long long n) {
  long long copy = n, count = 0;
  while (copy != 0) {
    if (copy % k != 0) {
      break;
    }
    copy /= k;
    count++;
  }
  return count;
}
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  int i;
  for (i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  int j;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < i; ++j) {
      if (arr[i] == arr[j]) {
        arr[j] = 0;
      }
    }
  }
  vector<int> ans;
  for (i = 0; i < n; ++i) {
    if (arr[i] != 0) {
      ans.push_back(arr[i]);
    }
  }
  cout << ans.size() << "\n";
  for (i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " ";
  }
}
