#include <bits/stdc++.h>
using namespace std;
const int maxN = 2 * (int)1e5 + 10;
string a[maxN], out[maxN];
int n, cs[maxN];
void Input() {
  cin >> n;
  for (int i = 0; i <= n; i++) cin >> a[i];
}
void Init() {
  for (int i = 0; i <= n - 1; i++) {
    cs[i] = i;
    out[i] = a[i];
  }
}
void Sort(int l, int r) {
  int i = l, j = r;
  string key = a[l + rand() % (r - l + 1)];
  while (i <= j) {
    while (a[i] < key) i++;
    while (a[j] > key) j--;
    if (i <= j) {
      swap(a[i], a[j]);
      swap(cs[i], cs[j]);
      i++;
      j--;
    }
  }
  if (i < r) Sort(i, r);
  if (l < j) Sort(l, j);
}
void Fisi() {
  string Name;
  int maxcs;
  for (int i = 0; i <= n; i++) {
    if (a[i] != Name) {
      Name = a[i];
      maxcs = cs[i];
    } else {
      if (cs[i] > maxcs) {
        out[maxcs] = "0";
        maxcs = cs[i];
      } else
        out[cs[i]] = "0";
    }
  }
}
void Solve() {
  Init();
  Sort(0, n - 1);
  Fisi();
}
void Output() {
  for (int i = n - 1; i >= 0; i--)
    if (out[i] != "0") cout << out[i] << " ";
}
int main() {
  Input();
  Solve();
  Output();
  return 0;
}
