#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void IN(vector<int> &v, int n, int x) {
  for (int i = x; i < n + x; ++i) cin >> v[i];
}
void PA(int v[], int n, int x = 0) {
  for (int i = x; i < n + x; i++) cout << v[i] << ' ';
  cout << endl;
}
void PV(vector<int> v, int n, int x) {
  for (int i = x; i < n + x; ++i) cout << v[i] << " ";
  cout << endl;
}
void PPV(vector<pair<int, int> > v, int n, int x) {
  for (int i = x; i < n + x; ++i)
    cout << v[i].first << " " << v[i].second << '\n';
}
const long long INF = (1LL << 60);
const int MOD = 1e9 + 7;
const int nax = 2e5 + 5;
const double p = 3.14159265359;
vector<int> vis(1002);
void run_case() {
  int n;
  cin >> n;
  vector<int> v(n), ans;
  IN(v, n, 0);
  for (int i = n - 1; i >= 0; --i) {
    if (!vis[v[i]]) {
      ans.push_back(v[i]);
      vis[v[i]] = 1;
    }
  }
  reverse((ans).begin(), (ans).end());
  cout << ((ans).size()) << endl;
  PV(ans, (ans).size(), 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int tt = 1;
loop:
  while (tt--) {
    run_case();
  }
  return 0;
}
