#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = pair<int, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vlli = vector<long long int>;
using vpii = vector<pair<int, int>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vi a(n), b, taken(1001, 0);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--)
    if (!taken[a[i]]) b.push_back(a[i]), taken[a[i]] = 1;
  cout << b.size() << '\n';
  for (int i = b.size() - 1; i >= 0; i--) cout << b[i] << "  ";
}
