#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool vis[55];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n), ans;
  for (auto &p : a) cin >> p;
  reverse(a.begin(), a.end());
  for (auto x : a) {
    if (vis[x] == 0) {
      vis[x] = 1;
      ans.push_back(x);
    }
  }
  reverse(ans.begin(), ans.end());
  cout << ans.size() << '\n';
  for (auto out : ans) cout << out << ' ';
  return 0;
}
