#include<iostream>
using namespace std;
class node
{
public:
    node *l;
    int data;
    node *r;
};
class list
{
private:
    int size;
public:
    node *root;
    list()
    {
        root=NULL;
    }
   unsigned long insert(int key)
    {   node *p=root,*t,*q;
        if(root==NULL)
        {
            t=new node;
            t->data=key;
            t->l=t->r=NULL;
            root=t;
            size=1;
            return size;
        }
        if(key<root->data)
        {
            while(p!=NULL && key<p->data)
            {
                q=p;
                p=p->l;

            }
            if(p!=NULL && p->data==key)
               {
                   q->l=p->l;
                   delete p;
                   size--;
                   return size;
               }
             else
             {
                t=new node;
                t->data=key;
                q->l=t;
                t->l=p;
                size++;
                return size;
             }
        }
        else if(key>root->data)
        {
            while(p!=NULL && key>p->data)
                {
                    q=p;
                    p=p->r;

                }
                        if(p!=NULL && p->data==key)
                        {
                            q->r=p->r;
                            delete p;
                            size--;
                            return size;
                        }
                        else
                        {
                            t=new node;
                            t->data=key;
                            q->r=t;
                            t->r=p;
                            size++;
                            return size;
                        }
        }

    }
};

int main()
{
   unsigned long max=0,n,*a,p,i,c;
    list t;
    cin>>p;
    n=p*2;
    a=new unsigned long[n];
    for(i=0;i<n;i++)
       {
        cin>>a[i];
        c = t.insert(a[i]);
        if(max<c)
            max=c;
       }
       cout<<max;

}


#include<iostream>
using namespace std;
int main()
{
int    p,q=0,max=0,n,i;
    cin>>p;
    n=p*2;
    int H[99999*2]={0};
    for(i=0;i<n;i++)
    {
        cin>>p;
        if(H[p]==0)
        {
            H[p]=1;
            q++;
        }
        else
        {
            H[p]=0;
            q--;
        }
        if(max < q)
            max=q;
    }
    cout<<max;

}


#include<iostream>
using namespace std;
class node
{
public:
    node *l;
    int data;
    node *r;
};
class list
{
private:
    int size;
public:
    node *root;
    list()
    {
        root=NULL;
    }
    int insert(int key)
    {   node *p=root,*t,*q;
        if(root==NULL)
        {
            t=new node;
            t->data=key;
            t->l=t->r=NULL;
            root=t;
            size=1;
            return size;
        }
        if(key<root->data)
        {
            while(p!=NULL && key<p->data)
            {
                q=p;
                p=p->l;

            }
            if(p!=NULL && p->data==key)
               {
                   q->l=p->l;
                   delete p;
                   size--;
                   return size;
               }
             else
             {
                t=new node;
                t->data=key;
                q->l=t;
                t->l=p;
                size++;
                return size;
             }
        }
        else if(key>root->data)
        {
            while(p!=NULL && key>p->data)
                {
                    q=p;
                    p=p->r;

                }
                        if(p!=NULL && p->data==key)
                        {
                            q->r=p->r;
                            delete p;
                            size--;
                            return size;
                        }
                        else
                        {
                            t=new node;
                            t->data=key;
                            q->r=t;
                            t->r=p;
                            size++;
                            return size;
                        }
        }

    }
};

int main()
{
    int max=0,n,*a,p,i,c;
    list t;
    cin>>p;
    n=p*2;
    a=new int[n];
    for(i=0;i<n;i++)
       {
        cin>>a[i];
        c = t.insert(a[i]);
        if(max<c)
            max=c;
       }
       cout<<max;

}


#include<iostream>
using namespace std;
int main()
{
   unsigned long long p,q=0,max=0,n,i;
    cin>>p;
    n=p*2;
    bool H[2*10001]={0};
    for(i=0;i<n;i++)
    {
        cin>>p;
        if(H[p]==0)
        {
            H[p]=1;
            q++;
        }
        else
        {
            H[p]=0;
            q--;
        }
        if(max < q)
            max=q;
    }
    cout<<max;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n*2];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n*2;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {
        int x=arr[i];
        brr[x]++;
        if(brr[x]==1)
        {
            p++;
            mx=max(mx,p);
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        if(brr[x]==2)
        {
            p--;
        }
    }
    cout<<mx<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n*2];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n*2;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n*2;i++)
    {
        int x=arr[i];
        brr[x]++;
        if(brr[x]==1)
        {
            p++;
            mx=max(mx,p);
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        if(brr[x]==2)
        {
            p--;
        }
    }
    cout<<mx<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n*2];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n*2;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {
        int x=arr[i];
        brr[x]++;
        if(brr[x]==0)
        {
            p++;
            mx=max(mx,p);
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        else
        {
            brr[x]--;
            p--;
        }
    }
    cout<<mx<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n*2];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n*2;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {
        int x=arr[i];
        if(brr[x]==0)
        {
            p++;
            brr[x]++;
            mx=max(mx,p);
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        else
        {
            brr[x]--;
            p--;
        }
    }
    cout<<mx<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {
        int x=arr[i];
        brr[x]++;
        if(brr[x]==1)
        {
            p++;
            mx=max(mx,p);
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        if(brr[x]==2)
        {
            p--;
        }
    }
    cout<<mx<<"\n";
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,p=0,mx=0;
    cin>>n;
    int arr[n*2];
    int brr[n+1];
    memset(brr,0,sizeof brr);
    for(int i=0;i<n*2;i++)
    {
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {
        int x=arr[i];
        if(brr[x]==0)
        {
            p++;
            brr[x]++;
            //cout<<p<<" "<<mx<<" "<<x<<"\n";
        }
        else
        {
            mx=max(mx,p);
            brr[x]--;
            p--;
        }

    }
    cout<<mx<<"\n";
}


#include <iostream>
#include<algorithm>
using namespace std;

int main()
{
  int n,a[200003]={0},i,q=0,s=0,x;
  cin>>n;
  for(i=0;i<2*n;i++)
  {
      cin>>x;
      a[x]++;
      if(a[x]<2)
      {
          s++;
      }
      else
      {
          s--;
      }
      q=max(q,s);

  }
  cout<<q;

}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <functional>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>

using namespace std;

int main() {

	int n; cin >> n;
	cin.ignore(1, '\n');

	unordered_set<int> socks;

	int current = 0;

	int mx = INT_MIN;

	while (cin.peek() != '\n') {

		int x; cin >> x;

		if (socks.count(x)) {
			mx = max(mx, current);
			current--;
		}
		else {
			socks.insert(x);
			current++;
		}
	}

	cout << mx;
}


#include<iostream>
using namespace std;
int main()
{
    int n,i,l=0,b,m=0;
    cin>>n;
    int a[100002]={0};
    for(i=0;i<2*n;i++) {
        cin>>b;
        a[b]=a[b]+1;
        if(a[b]==1)
            l++;
        else if(a[b]==2)
            l--;
        if(l>m)
            m=l;
    }
    cout<<m;
}


#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <iostream>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	map<int, int> m;
    int n;
    cin >> n;
    int maximum = 0;
    int k = 0;
    for (int i = 0; i < 2 * n; ++i) {
        int value;
        cin >> value;
        ++m[value];
        if (m[value] == 1) {
            ++k;
            maximum = max(maximum, k);
        }
        else if (m[value] == 2) {
            --k;
        }
    }
    cout << maximum << endl;
	return 0;
}


#include <iostream>
#include <set>

using namespace std;

int main(){
    set<int> s;
    int n;
    cin>>n;
    int tmp,c=0;
    for(int i = 0; i<n;i++){
        cin>>tmp;
        if(s.count(tmp))
        ++c;
        s.emplace(tmp);
    }
    cout<<c;
}


#include <iostream>
#include <set>

using namespace std;

int main(){
    set<int> s;
    int n;
    cin>>n;
    int tmp,c=0,max = 0;
    for(int i = 0; i<2*n;i++){
        cin>>tmp;
        if(s.count(tmp)){
        --c;

        }
        else{
            ++c;
        }
        if (c>max)
        max = c;
        s.emplace(tmp);
    }
    cout<<max;
}


#include <iostream>
#include <set>

using namespace std;

int main(){
    set<int> s;
    int n;
    cin>>n;
    int tmp,c=0;
    for(int i = 0; i<2*n;i++){
        cin>>tmp;
        if(s.count(tmp))
        ++c;
        s.emplace(tmp);
    }
    cout<<c;
}


#include <iostream>
#include <set>

using namespace std;

int main(){
    set<int> s;
    int n;
    cin>>n;
    int tmp,c=0;
    for(int i = 0; i<n;i++){
        cin>>tmp;
        if(s.count(tmp))
        ++c;
        s.emplace(tmp);
    }
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <string>

#define ll long long int
#define vec vector<int>
#define deq deque<int>
#define str string
#define get_ cin.get()

using namespace std;

int main()
{
	int n, k;
	cin >> n;
	n = n * 2;
	vec Vec_res, Vec_cont;
	while (n--) {
		cin >> k;
		Vec_cont.push_back(k);
	}
	vec::iterator it1, it2;
	bool ok;
	int max = 0, max_res = 0;
	for (it1 = Vec_cont.begin(); it1 < Vec_cont.end(); it1++) {
		ok = true;
		for (it2 = Vec_res.begin(); it2 < Vec_res.end() && ok; it2++) {
			if (*it1 == *it2) {
				ok = false;
			}
		}
		if (ok) {
			max++;
			if (max > max_res) {
				max_res = max;
			}
			Vec_res.push_back(*it1);
		}
		else {
			max--;
		}
	}
	cout << max_res << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <string>

#define ll long long int
#define vec vector<int>
#define deq deque<int>
#define str string
#define get_ cin.get()

using namespace std;

int main()
{
	int n, k;
	cin >> n;
	n = n * 2;
	vec Vec_res, Vec_cont;
	while (n--) {
		cin >> k;
		Vec_cont.push_back(k);
	}
	vec::iterator it1, it2;
	bool ok;
	for (it1 = Vec_cont.begin(); it1 < Vec_cont.end(); it1++) {
		ok = true;
		for (it2 = Vec_res.begin(); it2 < Vec_res.end(); it2++) {
			if (*it1 == *it2) {
				ok = false;
				break;
			}
		}
		if (ok) {
			Vec_res.push_back(*it1);
		}
	}
	cout << Vec_res.size() << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <string>

#define ll long long int
#define vec vector<int>
#define deq deque<int>
#define str string
#define get_ cin.get()

using namespace std;

int main()
{
	int n, k;
	cin >> n;
	n = n * 2;
	vec Vec_res, Vec_cont;
	while (n--) {
		cin >> k;
		Vec_cont.push_back(k);
	}
	vec::iterator it1, it2;
	bool ok;
	int max = 0, max_res = 0;
	for (it1 = Vec_cont.begin(); it1 < Vec_cont.end(); it1++) {
		ok = true;
		for (it2 = Vec_res.begin(); it2 < Vec_res.end(); it2++) {
			if (*it1 == *it2) {
				ok = false;
				break;
			}
		}
		if (ok) {
			max++;
			if (max > max_res) {
				max_res = max;
			}
			Vec_res.push_back(*it1);
		}
		else {
			max--;
		}
	}
	cout << max_res << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <string>

#define ll long long int
#define vec vector<int>
#define deq deque<int>
#define str string
#define get_ cin.get()

using namespace std;

int main()
{
	int n, k;
	cin >> n;
	n = n * 2;
	vec Vec_res, Vec_cont;
	while (n--) {
		cin >> k;
		Vec_cont.push_back(k);
	}
	vec::iterator it1, it2;
	bool ok;
	int max = 0;
	for (it1 = Vec_cont.begin(); it1 < Vec_cont.end(); it1++) {
		ok = true;
		for (it2 = Vec_res.begin(); it2 < Vec_res.end(); it2++) {
			if (*it1 == *it2) {
				ok = false;
				Vec_res.erase(it2);
				break;
			}
		}
		if (ok) {
			Vec_res.push_back(*it1);
			if (Vec_res.size() > max) {
				max = Vec_res.size();
			}
		}
	}
	cout << max << endl;
}


#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> vec(n*2);
    for (int i = 0; i < n*2; ++i) {
        cin >> vec[i];
    }
    int count = 1;
    for (int i = 1; i < vec.size(); ++i) {
        if (vec[i] != vec[i-1]) count++;
    }
    cout << (count == 1? 1: count/2) << endl;

return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> vec(n*2), a;
    for (int i = 0; i < n*2; ++i) {
        cin >> vec[i];
    }
    int count = 0, mx = -1, k;
    bool b = false;
    for (int i = 0; i < vec.size(); ++i) {
        for (int j = 0; j < a.size(); ++j) {
            if (vec[i] == a[j]) {
                b = true;
                k = j;
                break;
            }
        }
        if (b == false) {
            count++;
            a.push_back(vec[i]);
        } else {
            count--;
            a.erase(a.begin() + k);
            b = false;
        }
        mx = max(mx, count);
    }
    cout << mx << endl;

return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> vec(n*2), a;
    for (int i = 0; i < n*2; ++i) {
        cin >> vec[i];
    }
    int count = 0, mx = -1;
    bool b = false;
    for (int i = 0; i < vec.size(); ++i) {
        for (int j = 0; j < a.size(); ++j) {
            if (vec[i] == a[j]) {
                b = true;
                break;
            }
        }
        if (b == false) {
            count++;
            a.push_back(vec[i]);
        } else {
            count--;
            b = false;
        }
        mx = max(mx, count);
    }
    cout << mx << endl;

return 0;
}


#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;

const int N = 1e6;
int socks[N];
int found[N];
int main()
{
	int x;
	int number = 0;
	int tmp;
	int max = 0;
	memset(found, 0, sizeof(found));
	cin >> x;
	for (int i = 0; i < (2*x); i++)
	{
		cin >> socks[i];
	}

	for (int i = 0; i < (2 * x); i++)
	{
		tmp = socks[i];
		if (found[tmp] == 0)
		{
			found[tmp] = 1;
			number = number + 1;
		}
		else
		{
			number = number - 1;
		}
		if (number > max)
			max = number;
	}
	cout << max;
//	system("pause");
	return 0;
}


//DPcoded

#include <iostream>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <iomanip>

using namespace std;

/*
ifstream in("input.txt");
ofstream out("output.txt");
#define In in
#define Out out
/**/
#define In cin
#define Out cout
/**/

#define all(x) x.begin(), x.end()
#define p2(x) (x) * (x)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)

typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ii, ii> pp;
typedef vector <int> vi;
typedef vector <string> vs;
typedef vector <char> vc;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vi> vvi;
typedef set <int> si;
typedef map <int, int> mii;

si s;

int main() {
	int n;
	In >> n;

	int cnt = 0;

	FOR(i, 0, 2 * n) {
		int t;
		In >> t;
		if (s.find(t) == s.end()) {
			s.insert(t);
			cnt = max(cnt, int(s.size()));
		}
		else s.erase(t);
	}

	Out << cnt;

	return 0;
}


#include<iostream>
using namespace std;
const int maxn=2e5+5;
int flag[maxn];
int sock[maxn];
int max(int a,int b){
    return a>b?a:b;
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<2*n;i++){
        cin>>sock[i];
    }
    int count=0;
    int m=0;
    for(int i=0;i<2*n;i++){
        if(flag[sock[i]]){
            count--;
        }
        else{
            flag[sock[i]]=1;
            count++;
            m=max(m,count);
        }
    }
    cout<<m;
    return 0;
}


#include <iostream>
#include <vector>
#include <set>

using namespace std;

int main() {
   int n;
   cin >> n;
   int a, w = 0;
   set <int> s;
   int m = 0;
   for (int i = 0; i < 2 * n; i++)
   {
      cin >> a;
      if ((s.find(a) != s.end()) && (w > 0))
         w--;
      else
         w++;
         s.insert(a);
      if (w > m) m = w;

   }
   cout << m;

    return 0;
}


#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
const int maxn = 2000005;
int n;
int main() {
	cin.tie(0);
	cin >> n;
	int ans = 0;
	set<int> s;
	for (int i = 0; i < 2 * n;i++) {
		int a;
		cin >> a;
		if (s.find(a) != s.end()) {
			s.erase(a);
		}
		else s.insert(a);
		ans = max(ans, (int)s.size());
	}
	cout << ans;
	return 0;
}


#include <iostream>
using namespace std;
int main() {
	int n, table[200000], ans = 0, max = 0;
	cin >> n;
	for (int i = 0; i < 2*n; i++) {
		cin >> table[i];
		ans++;
		for (int j = 0; j < i; j++) {
			if (table[j] == 0) {
				continue;
			}
			if (table[j] == table[i]) {
				ans-=2;
				table[i] = 0;
				table[j] = 0;
				break;
			}
		}
		if (max < ans) {
			max = ans;
		}
	}
	cout << max;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n;
	int buff;
	int caunt = 0;
	int max = 0;
	cin >> n;
	bool *m = new bool[n+1];
	for (int i = 0; i < n+1; i++)
	{
		m[i] = false;
	}

	for (int i = 0; i < 2*n; i++)
	{
		cin>> buff;
		if (m[buff])
		{
			if (caunt > max)
				max = caunt;
			caunt--;
		}
		else
		{
			m[buff] = true;
			caunt++;
		}
	}

	cout << max;
	system("pause");
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n;
	int buff;
	int caunt = 0;
	int max = 0;
	cin >> n;
	bool* m = new bool[n + 1];
	for (int i = 0; i < n + 1; i++)
	{
		m[i] = false;
	}

	for (int i = 0; i < 2 * n; i++)
	{
		cin >> buff;
		if (m[buff])
		{
			if (caunt > max)
				max = caunt;
			caunt--;
		}
		else
		{
			m[buff] = true;
			caunt++;
		}
	}

	cout << max;
	return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n;
	int buff;
	int caunt = 0;
	int max = 0;
	cin >> n;

	int lim1 = n + 1;

	bool* m = new bool[lim1];
	for (int i = 0; i < lim1; i++)
	{
		m[i] = false;
	}

	int lim2 = 2 * n;

	for (int i = 0; i != lim2; i++)
	{
		cin >> buff;
		if (m[buff])
		{
			if (caunt > max)
				max = caunt;
			caunt--;
		}
		else
		{
			m[buff] = true;
			caunt++;
		}
	}

	cout << max;
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	int n,*a,count=0,max=0;
	cin>>n;
	a=new int [2*n];
	for(int i=0; i<2*n; i++){
		cin>>a[i];
		count++;
		for(int j=0; j<i; j++){
			if(a[i]==a[j]){
				if(count>max) max=count-1;
				count-=2;
				break;
			}
		}
	}
	cout<<max;
}


#include <iostream>
using namespace std;
int main(){
	int n,x,max=0,count=0;
	cin>>n;
	bool *a;
	a=new bool [n];
	for(int i=0; i<n; i++)
		a[i]=false;
	for(int i=0; i<2*n; i++){
		cin>>x;
		if(!a[x-1]){
			a[x-1]=true;
			count++;
		}
		else{
			if(count>max) max=count;
			count--;
		}
	}
	cout<<max;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include <initializer_list>
#include<unordered_set>
#include<map>
#include<cmath>
#include <iterator>
#include<stack>
#include<queue>
#include <iomanip>
#include<math.h>
#include <limits.h>
#include <numeric>
#include <functional>
using namespace std;
void past_code();
int r[100009];
int main(){
	int x,q,c=0,ans=0;
	cin>>x;

	for (int i=0;i<2*x;i++)
	{
		cin>>q;
		if (r[q]==0){
			c++;
			r[q]++;
		}
		else{
			c--;
			r[q]--;
		}
		ans=max(ans,c);
	}
	cout<<ans<<endl;
	return 0;
}


#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
   long int n,*a,*b,c=0,z=0,m;
   cin>>n;
   m=2*n;
   b=(long int*)calloc(sizeof(long int),n);
   a=(long int*)malloc(sizeof(long int)*m);
   for(long int i=0;i<m;i++)
   {
       cin>>a[i];
       b[a[i]-1]++;
       if(b[a[i]-1]==1){c++;}
       else{c--;}
       if(c>z){z=c;}
   }
   cout<<z;
   return 0;

}


#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
   long int n,*a,*b,c=0,z=0;
   cin>>n;
   m=2*n;
   b=(long int*)calloc(sizeof(long int)*n);
   a=(long int*)malloc(sizeof(long int)*m);
   for(long int i=0;i<m;i++)
   {
       cin>>a[i];
       b[a[i]-1]++;
       if(b[a[i]-1]==1){c++;}
       else{c--;}
       if(c>z){z=c;}
   }
   cout<<z;
   return 0;

}


using System;
using System.Collections.Generic;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<string> nameList = new List<string>();

            for (int i = 0; i < n; i++)
            {
                string temp = Console.ReadLine();

                if (nameList.IndexOf(temp) != -1)
                {
                    nameList.RemoveAt(nameList.IndexOf(temp));
                    nameList.Add(temp);
                }
                else
                {
                    nameList.Add(temp);
                }
            }

            nameList.Reverse();

            foreach (string str in nameList)
            {
                Console.WriteLine(str);
            }

            //Console.ReadKey();
        }
    }
}


using System;
using System.Collections.Generic;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<string> nameList = new List<string>();
            HashSet<string> nameSet = new HashSet<string>();

            for (int i = 0; i < n; i++)
            {
                nameList.Add(Console.ReadLine());
            }

            for (int i = nameList.Count-1; i >= 0; i--)
            {
                if (!nameSet.Contains(nameList[i]))
                {
                    nameSet.Add(nameList[i]);
                    Console.WriteLine(nameList[i]);
                }
            }

            //Console.ReadKey();
        }

    }
}


using System;
using System.Collections.Generic;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            List<string> nameList = new List<string>();
            List<int> booList = new List<int>();

            for (int i = 0; i < n; i++)
            {
                string temp = Console.ReadLine();
                int ind = nameList.IndexOf(temp);
                if (ind != -1)
                {
                    nameList[ind] = "";
                    booList[ind] = 0;
                }
                nameList.Add(temp);
                booList.Add(1);

            }

            for (int i = nameList.Count-1; i >= 0; i--)
            {
                if (booList[i] == 1)
                    Console.WriteLine(nameList[i]);
            }

            //Console.ReadKey();
        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;

public class A
{
  private static void Main()
  {
    //Console.ReadLine().Split(' ').Select(int.Parse).Select(x => x - 1).Reverse().ToList().ForEach(x => Console.Write(x + " "));
    //HashSet<int> hs = new HashSet<int>();
    //bool r = hs.Add(2);
    //r = hs.Add(4);
    //r = hs.Add(2);

    Enumerable.Range(0, int.Parse(Console.ReadLine())).Select(_ => Console.ReadLine()).Reverse().Distinct().ToList().ForEach(x => Console.WriteLine(x));
  }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

// (づ°ω°)づﾐe★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public void Solve()
    {
        int n = ReadInt();
        var a = ReadLines(n);

        var set = new HashSet<string>();
        for (int i = n - 1; i >= 0; i--)
            if (!set.Contains(a[i]))
            {
                set.Add(a[i]);
                Write(a[i]);
            }
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;
    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        //reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            //var thread = new Thread(new Solver().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
            new Solver().Solve();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write
    private static Queue<string> currentLineTokens = new Queue<string>();
    private static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }
    public static string ReadToken() { while (currentLineTokens.Count == 0)currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue(); }
    public static int ReadInt() { return int.Parse(ReadToken()); }
    public static long ReadLong() { return long.Parse(ReadToken()); }
    public static double ReadDouble() { return double.Parse(ReadToken(), CultureInfo.InvariantCulture); }
    public static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    public static long[] ReadLongArray() { return ReadAndSplitLine().Select(long.Parse).ToArray(); }
    public static double[] ReadDoubleArray() { return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray(); }
    public static int[][] ReadIntMatrix(int numberOfRows) { int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++)matrix[i] = ReadIntArray(); return matrix; }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++)ret[i][j] = matrix[j][i]; } return ret;
    }
    public static string[] ReadLines(int quantity) { string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++)lines[i] = reader.ReadLine().Trim(); return lines; }
    public static void WriteArray<T>(IEnumerable<T> array) { writer.WriteLine(string.Join(" ", array)); }
    public static void Write(params object[] array) { WriteArray(array); }
    public static void WriteLines<T>(IEnumerable<T> array) { foreach (var a in array)writer.WriteLine(a); }
    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    private static T[] Init<T>(int size) where T : new() { var ret = new T[size]; for (int i = 0; i < size; i++)ret[i] = new T(); return ret; }
    #endregion
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace VK
{
    class Program
    {
        struct Chat
        {
            public string name;
            public int turn;

            public Chat(string name, int turn)
            {
                this.name = name;
                this.turn = turn;
            }
        }

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var dir = new Dictionary<string, int>();
            for (var i = 0; i < n; i++)
            {
                var name = Console.ReadLine();
                if (!dir.ContainsKey(name))
                    dir.Add(name, i);
                else
                    dir[name] = i;
            }
            var output = from el in dir orderby el.Value descending select el.Key;
            foreach (var str in output)
            {
                Console.WriteLine(str);
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

class Program
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        string[] data = new string[n];
        for (int i = n - 1; i >= 0; --i)
            data[i] = Console.ReadLine();
        SortedSet<string> buffer = new SortedSet<string>();
        foreach (string item in data)
        {
            if (buffer.Contains(item))
                continue;
            Console.WriteLine(item);
            buffer.Add(item);
        }
    }
}


using System;
using System.Collections.Generic;

namespace CodeForces.Problems.B
{
    class _637
    {
        public static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var stack = new Stack<string>(n);

            for (int i = 0; i < n; i++)
            {
                stack.Push(Console.ReadLine());
            }

            var set = new HashSet<string>(stack);
            Console.Write(string.Join(Environment.NewLine, set));
        }
    }
}


using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;

public class Solver
{

    void Solve()
    {
        int n = Int32.Parse(reader.ReadLine());

        var chats = new List<string>();
        for (int i = 0; i < n; i++)
        {
            chats.Add(reader.ReadLine());
        }

        var result = new List<string>();
        var used = new HashSet<string>();

        foreach (var chat in chats.Reverse<string>())
        {
            if (!used.Contains(chat))
            {
                result.Add(chat);
                used.Add(chat);
            }
        }

        foreach (var chat in result)
        {
            writer.WriteLine(chat);
        }
    }

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        //reader = new StreamReader("..\\..\\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());

        try
        {
            new Solver().Solve();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }

        reader.Close();
        writer.Close();
    }

    static int[] ReadIntArray() { return ReadAndSplitLine().Select(int.Parse).ToArray(); }
    static string[] ReadAndSplitLine() { return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries); }

    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = new string[n];
            for (int i = 0; i < n; i++)
            {
                s[i] = Console.ReadLine();
            }
            List<string> list = new List<string>();
            for (int i = n - 1; i >= 0; i--)
            {
                if (!list.Contains(s[i]))
                {
                    list.Add(s[i]);
                    Console.WriteLine(s[i]);
                }
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = new string[n];
            for (int i = 0; i < n; i++)
            {
                s[i] = Console.ReadLine();
            }
            HashSet<string> list = new HashSet<string>();
            for (int i = n - 1; i >= 0; i--)
            {
                if (!list.Contains(s[i]))
                {
                    list.Add(s[i]);
                    Console.WriteLine(s[i]);
                }
            }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] s = new string[n];
            for (int i = 0; i < n; i++)
            {
                s[i] = Console.ReadLine();
            }
            List<string> list = new List<string>();
            for (int i = n - 1; i >= 0; i--)
            {
                if (!list.Contains(s[i]))
                {
                    list.Add(s[i]);
                }
            }
            foreach (string st in list)
            {
                Console.WriteLine(st);
            }
        }
    }
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.math.BigDecimal
import java.math.BigInteger
import java.util.*
import java.util.concurrent.ConcurrentHashMap

object programkt {
    internal class FastScanner(inpStr: InputStream, var br: BufferedReader = BufferedReader(InputStreamReader(inpStr)), var stok: StringTokenizer? = null){
        fun nextToken(): String? {
            while (stok == null || !stok!!.hasMoreTokens()) {
                val s = br.readLine() ?: return null
                stok = StringTokenizer(s)
            }
            return stok!!.nextToken()
        }

        fun nextInt() = nextToken()!!.toInt()
        fun nextLong() = nextToken()!!.toLong()
        fun nextDouble() = nextToken()!!.toDouble()
        fun nextChar() = br.read().toChar()
        fun nextLine() = br.readLine()
        fun nextBigInteger() = BigInteger(nextToken()!!)
        fun nextBigDecimal() = BigDecimal(nextToken()!!)
    }

    fun <T:Comparable<T>> min(a: T, b: T) = if (a > b) b else a
    fun <T:Comparable<T>> max(a: T, b: T) = if (a < b) b else a

    @JvmStatic fun main(args: Array<String>) {
        val scanner = FastScanner(System.`in`)
        val n = scanner.nextInt()
        val queue = ArrayList<String>()
        val names = Array<String>(200000) { "" }

        (0 until n).forEach { names[it] = scanner.nextLine() }
        for(it in (n-1 downTo 0)) {
            if(queue.contains(names[it]))
                continue
            queue.add(names[it])
            println(names[it])
        }
    }
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.math.BigDecimal
import java.math.BigInteger
import java.util.*
import java.util.concurrent.ConcurrentHashMap

object programkt {
    internal class FastScanner(inpStr: InputStream, var br: BufferedReader = BufferedReader(InputStreamReader(inpStr)), var stok: StringTokenizer? = null){
        fun nextToken(): String? {
            while (stok == null || !stok!!.hasMoreTokens()) {
                val s = br.readLine() ?: return null
                stok = StringTokenizer(s)
            }
            return stok!!.nextToken()
        }

        fun nextInt() = nextToken()!!.toInt()
        fun nextLong() = nextToken()!!.toLong()
        fun nextDouble() = nextToken()!!.toDouble()
        fun nextChar() = br.read().toChar()
        fun nextLine() = br.readLine()
        fun nextBigInteger() = BigInteger(nextToken()!!)
        fun nextBigDecimal() = BigDecimal(nextToken()!!)
    }

    fun <T:Comparable<T>> min(a: T, b: T) = if (a > b) b else a
    fun <T:Comparable<T>> max(a: T, b: T) = if (a < b) b else a

    @JvmStatic fun main(args: Array<String>) {
        val scanner = FastScanner(System.`in`)
        val n = scanner.nextInt()
        val queue = ArrayList<String>()
        (0 until n).forEach {
            val person = scanner.nextLine()
            if (queue.contains(person)) {
                queue.remove(person)
            }
            queue.add(person)
        }
        queue.reversed().forEach { println(it) }
    }
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.math.BigDecimal
import java.math.BigInteger
import java.util.*
import java.util.concurrent.ConcurrentHashMap

object programkt {
    internal class FastScanner(inpStr: InputStream, var br: BufferedReader = BufferedReader(InputStreamReader(inpStr)), var stok: StringTokenizer? = null){
        fun nextToken(): String? {
            while (stok == null || !stok!!.hasMoreTokens()) {
                val s = br.readLine() ?: return null
                stok = StringTokenizer(s)
            }
            return stok!!.nextToken()
        }

        fun nextInt() = nextToken()!!.toInt()
        fun nextLong() = nextToken()!!.toLong()
        fun nextDouble() = nextToken()!!.toDouble()
        fun nextChar() = br.read().toChar()
        fun nextLine() = br.readLine()
        fun nextBigInteger() = BigInteger(nextToken()!!)
        fun nextBigDecimal() = BigDecimal(nextToken()!!)
    }

    fun <T:Comparable<T>> min(a: T, b: T) = if (a > b) b else a
    fun <T:Comparable<T>> max(a: T, b: T) = if (a < b) b else a

    @JvmStatic fun main(args: Array<String>) {
        val scanner = FastScanner(System.`in`)
        val n = scanner.nextInt()
        val queue = HashSet<String>()
        val names = Array<String>(200000) { "" }

        (0 until n).forEach { names[it] = scanner.nextLine() }
        for(it in (n-1 downTo 0)) {
            if(queue.contains(names[it]))
                continue
            queue.add(names[it])
            println(names[it])
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
const int N = 200000;

string names[N];
set<string> counter;

int main(void){
    int length;
    cin >> length;
	for (int i = 0; i < length; i++) {
		cin >> a[i];
	}
	for (int i = length - 1; i >= 0; i--) {
		if(names.count(a[i]))
			continue;
		names.insert(a[i]);
		cout << a[i] << "\n";
	}
}


@file:Suppress("NOTHING_TO_INLINE", "EXPERIMENTAL_FEATURE_WARNING", "OVERRIDE_BY_INLINE")

import java.io.PrintWriter
import java.util.StringTokenizer
import kotlin.math.*
import kotlin.random.*
import kotlin.collections.sort as _sort
import kotlin.collections.sortDescending as _sortDescending

/** @author Om Kumar */
fun main() { _writer.solve(); _writer.flush() }

fun PrintWriter.solve() {
    val n = readInt()
    val s = readStrings(n).reversed()
    val set = HashSet<String>()
    val list = mutableListOf<String>()
    s.forEach{
        if(!set.contains(it)){
            set.add(it)
            list.add(it)
        }
    }
    println(list.joinToString("\n"))
}

/** IO code start */
//@JvmField val INPUT = File("input.txt").inputStream()
//@JvmField val OUTPUT = File("output.txt").outputStream()
@JvmField val INPUT = System.`in`
@JvmField val OUTPUT = System.out

@JvmField val _reader = INPUT.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readLines(n: Int) = List(n) { readLn() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readIntArray(n: Int) = IntArray(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }
fun readLongArray(n: Int) = LongArray(n) { read().toLong() }

@JvmField val _writer = PrintWriter(OUTPUT, false)

/** shuffles and sort overrides to avoid quicksort attacks */
private inline fun <T> _shuffle(rnd: Random, get: (Int) -> T, set: (Int, T) -> Unit, size: Int) {
    // Fisher-Yates shuffle algorithm
    for (i in size - 1 downTo 1) {
        val j = rnd.nextInt(i + 1)
        val temp = get(i)
        set(i, get(j))
        set(j, temp)
    }
}

@JvmField var _random: Random? = null
val random get() = _random ?: Random(0x58359625447 * System.nanoTime()).also { _random = it }

fun IntArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun IntArray.sort() { shuffle(); _sort() }
fun IntArray.sortDescending() { shuffle(); _sortDescending() }

fun LongArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun LongArray.sort() { shuffle(); _sort() }
fun LongArray.sortDescending() { shuffle(); _sortDescending() }

fun DoubleArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
fun DoubleArray.sort() { shuffle(); _sort() }
fun DoubleArray.sortDescending() { shuffle(); _sortDescending() }

fun CharArray.shuffle(rnd: Random = random) = _shuffle(rnd, ::get, ::set, size)
inline fun CharArray.sort() { _sort() }
inline fun CharArray.sortDescending() { _sortDescending() }

inline fun <T: Comparable<T>> Array<out T>.sort() = _sort()
inline fun <T: Comparable<T>> Array<out T>.sortDescending() = _sortDescending()
inline fun <T: Comparable<T>> MutableList<out T>.sort() = _sort()
inline fun <T: Comparable<T>> MutableList<out T>.sortDescending() = _sortDescending()


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.HashMap

object programkt {
    internal class FastScanner(inpStr: InputStream, private var br: BufferedReader = BufferedReader(InputStreamReader(inpStr)), private var stok: StringTokenizer? = null) {
        private fun nextToken(): String? {
            while (stok == null || !stok!!.hasMoreTokens())
                stok = StringTokenizer(br.readLine() ?: return null)
            return stok!!.nextToken()
        }

        fun nextInt() = nextToken()!!.toInt()
        fun nextString() = nextToken()!!.toString()
    }

    @JvmStatic
    fun main(args: Array<String>) {
        val sc = FastScanner(System.`in`)

        val peopleCount = sc.nextInt()

        val peopleChat = arrayOfNulls<String>(peopleCount)
        val allPeople = HashMap<String, Int>()

        ((peopleCount - 1) downTo 0).forEach(fun(index: Int) {
            val people = sc.nextString()

            allPeople[people]?.let {
                peopleChat[it] = null
                peopleChat[index] = people
                allPeople.replace(people, index)
            } ?: {
                peopleChat[index] = people
                allPeople.put(people, index)
            }()
        })

        peopleChat.forEach { it?.let(::println) }
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct __listnode {
    char data[11];
    struct __listnode *next;
    struct __listnode *prev;
    struct __listnode *right;
    struct __listnode *left;
} Node;

Node *createNewNode(char *data) {
    Node *newNode = (Node *)malloc(sizeof(Node));
    newNode->next = newNode;
    newNode->prev = newNode;
    newNode->left = 0;
    newNode->right = 0;
    if (data != 0) {
        strcpy(newNode->data, data);
    }

    return newNode;
}

void insertNode(Node *newNode, Node *prev, Node *next) {
    prev->next = newNode;
    next->prev = newNode;

    newNode->prev = prev;
    newNode->next = next;
}

void removeNode(Node *remove) {
    remove->next->prev = remove->prev;
    remove->prev->next = remove->next;
}

void destroy(Node *list) {
    Node *t1 = list->next;
    Node *t2 = 0;

    while (t1 != list) {
        t2 = t1->next;
        removeNode(t1);
        free(t1);
        t1 = t2;
    }

    free(list);
}

void insertTree(Node *root, Node *newNode) {
    int cmp = strcmp(root->data, newNode->data);
    if (cmp < 0) {
        if (root->left == 0) {
            root->left = newNode;
        } else {
            insertTree(root->left, newNode);
        }
    } else {
        if (root->right == 0) {
            root->right = newNode;
        } else {
            insertTree(root->right, newNode);
        }
    }
}

Node *findNode(Node *root, char *data) {
    if (root == 0) {
        return 0;
    }

    int cmp = strcmp(root->data, data);
    if (cmp == 0) {
        return root;
    } else if (cmp < 0) {
        return findNode(root->left, data);
    } else {
        return findNode(root->right, data);
    }
}

void printList(Node *list) {
    Node *p = list->next;

    while (p != list) {
        printf("%s\n", p->data);
        p = p->next;
    }
}

int main(void) {
    int n = 0, i = 0;
    Node *list = createNewNode(0);
    Node *root = 0, *node = 0;
    char name[11] = {0, };

    scanf("%d", &n);
    for (i=0;i<n;i++) {
        scanf("%s", name);
        if (root == 0) {
            node = createNewNode(name);
            root = node;
            insertNode(node, list, list->next);
        } else {
            node = findNode(root, name);
            if (node == 0) {
                node = createNewNode(name);
                insertNode(node, list, list->next);
                insertTree(root, node);
            } else {
                removeNode(node);
                insertNode(node, list, list->next);
            }
        }
    }

    printList(list);
    destroy(list);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct bor_element{
	struct bor_element *next[26];
}letter;

void free_bor(letter *root)
{
	int i;

	for(i = 0; i < 26; i++)
	{
		if(root->next[i])
			free_bor(root->next[i]);
	}
	free(root);
}
char add_word(letter *root, char *word)
{
	letter *new_letter;
	char exists = 1;
	int i;

	if(word[0] != '\0')
	{
		if(root->next[(int)(word[0] - 'a')] != NULL)
			exists = add_word(root->next[(int)(word[0] - 'a')], word + 1);
		else
		{
			new_letter = malloc(sizeof(letter));
			for(i = 0; i < 26; i++)
				new_letter->next[i] = NULL;
			root->next[(int)(word[0] - 'a')] = new_letter;
			add_word(new_letter, word + 1);
			exists = 0;
		}
	}

	return exists;
}

int main()
{
	int i, j = 0, n;
	char exists = 0, **mail, **new_order;
	letter *root;

	scanf("%u", &n);
	mail = malloc(n * sizeof(char*));
	new_order = malloc(n * sizeof(char*));
	for(i = 0; i < n; i++)
	{
		mail[i] = malloc(11 * sizeof(char));
		scanf("%s", mail[i]);
	}
	root = malloc(sizeof(letter));
	for(i = 0; i < 26; i++)
		root->next[i] = NULL;
	for(i = n - 1; i >= 0; i--)
	{
		exists = add_word(root, mail[i]);
		if(!exists)
		{
			new_order[j] = malloc(11 * sizeof(char));
			strcpy(new_order[j], mail[i]);
			j++;
		}
	}
	for(i = 0; i < j; i++)
		printf("%s\n", new_order[i]);

	for(i = 0; i < j; i++)
		free(new_order[i]);
	for(i = 0; i < n; i++)
		free(mail[i]);
	free(new_order);
	free(mail);
	free_bor(root);

	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct bor_element{
	struct bor_element *next[26];
	int last;
}letter;

void free_bor(letter *root)
{
	int i;

	for(i = 0; i < 26; i++)
	{
		if(root->next[i])
			free_bor(root->next[i]);
	}
	free(root);
}

char add_word(letter *root, char *word)
{
	letter *new_letter;
	char exists = 1;
	int i;

	if(word[0] != '\0')
	{
		if(root->next[(int)(word[0] - 'a')] != NULL)
			exists = add_word(root->next[(int)(word[0] - 'a')], word + 1);
		else
		{
			new_letter = malloc(sizeof(letter));
			for(i = 0; i < 26; i++)
				new_letter->next[i] = NULL;
			new_letter->last = 0;
			root->next[(int)(word[0] - 'a')] = new_letter;
			add_word(new_letter, word + 1);
			exists = 0;
		}
	}
	else if(!root->last)
	{
		exists = 0;
		root->last = 1;
	}

	return exists;
}

int main()
{
	int i, j = 0, n;
	char exists = 0, **mail, **new_order;
	letter *root;

	scanf("%u", &n);
	mail = malloc(n * sizeof(char*));
	new_order = malloc(n * sizeof(char*));
	for(i = 0; i < n; i++)
	{
		mail[i] = malloc(11 * sizeof(char));
		scanf("%s", mail[i]);
	}
	root = malloc(sizeof(letter));
	for(i = 0; i < 26; i++)
		root->next[i] = NULL;
	root->last = 0;
	for(i = n - 1; i >= 0; i--)
	{
		exists = add_word(root, mail[i]);
		if(!exists)
		{
			new_order[j] = malloc(11 * sizeof(char));
			strcpy(new_order[j], mail[i]);
			j++;
		}
	}
	for(i = 0; i < j; i++)
		printf("%s\n", new_order[i]);

	for(i = 0; i < j; i++)
		free(new_order[i]);
	for(i = 0; i < n; i++)
		free(mail[i]);
	free(new_order);
	free(mail);
	free_bor(root);

	return 0;
}


#include <stdio.h>
#include <string.h>

typedef struct {
    char show;
    int next[26];
} Node_t;
Node_t Trie[2000001];
char Str[2000001][11];

int main()
{
    int N, i, j;
    scanf("%d", &N);
    for(i = 0; i < N; ++i) {
        scanf("%s", Str[i]);
    }
    memset(Trie[0].next, -1, sizeof(Trie[0].next));
    int alloc = 1;
    for(i = N - 1; i >= 0; --i) {
        int s = 0;
        int l = strlen(Str[i]);
        for(j = 0; j < l; ++j) {
            if(Trie[s].next[Str[i][j] - 'a'] == -1) {
                memset(Trie[alloc].next, -1, sizeof(Trie[alloc].next));
                Trie[s].next[Str[i][j] - 'a'] = alloc;
                ++alloc;
            }
            s = Trie[s].next[Str[i][j] - 'a'];
        }
        if(!Trie[s].show) {
            puts(Str[i]);
            Trie[s].show = 1;
        }
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

typedef struct {
    int next[26];
} Node_t;
Node_t Trie[2000001];
char Str[2000001][11];

int main()
{
    int N, i, j;
    scanf("%d", &N);
    for(i = 0; i < N; ++i) {
        scanf("%s", Str[i]);
    }
    memset(Trie[0].next, -1, sizeof(Trie[0].next));
    int alloc = 1;
    for(i = N - 1; i >= 0; --i) {
        int s = 0;
        int l = strlen(Str[i]);
        char show = 0;
        for(j = 0; j < l; ++j) {
            if(Trie[s].next[Str[i][j] - 'a'] == -1) {
                show = 1;
                memset(Trie[alloc].next, -1, sizeof(Trie[alloc].next));
                Trie[s].next[Str[i][j] - 'a'] = alloc;
                ++alloc;
            }
            s = Trie[s].next[Str[i][j] - 'a'];
        }
        if(show) {
            puts(Str[i]);
        }
    }
    return 0;
}


//另一个想法是利用hash
//a~z 0~25
//aa~zz
//aa->0
//ab->1
//az->25
//ba->26
//bb->27
//zz->25*26+25
//zzz->26*26*25+25*26+25
//zz...z->(26^9*25+25*26^8+...+25)
//26^10太大了
//另一个想法是：
//建立hashtable，对hashtable进行sort！
//记录name出现的最大位置
//选择一个hash function
//建立hashtable
//同时记录每一个table的最大出现位置。
//最后根据最大出现位置排序hash table
#define N 200001
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define M 10000
int hash(char *s){
    int hash=0;
    int R=19;
    int i;
    for(i=0;s[i]!='\0';i++){
        hash=(R*hash+s[i])%M;
    }
    return hash;
}
struct node{
    char data[11];
    int position;
    struct node * next;
};
struct node * table[M];
int main() {
    int n;
    scanf("%d",&n);
    //我用hash与hash table来减少查找时间！
    int i;
    for(i=0;i<M;i++){
        table[i]=NULL;
    }
    for(i=0;i<n;i++){
        char name[11];
        scanf("%s",name);
        int h=hash(name);
        //printf("hash %s = %d\n",name,h);
        if(table[h]==NULL){
            table[h]=malloc(sizeof(struct node));
            if(table[h]==NULL){
                printf("未分配到内存\n");
                exit(1);
            }
            strcpy(table[h]->data,name);
            table[h]->position=i;
            table[h]->next=NULL;
        }else{
            int find=0;
            struct node * cur = table[h];
            while(cur!=NULL){
                if(strcmp(cur->data,name)==0){
                    cur->position=i;//对位置进行一个更新
                    find=1;
                    break;
                }
                cur=cur->next;
            }
            if(!find){
                struct node * new=malloc(sizeof(struct node));
                if(new==NULL){
                    printf("未分配到内存\n");
                    exit(1);
                }
                strcpy(new->data,name);
                new->position=i;
                new->next=table[h];
                table[h]=new;
            }
        }
    }
    /*
    for(i=0;i<M;i++){
        struct node * cur = table[i];
        while(cur!=NULL){
            printf("%s at %d\n",cur->data,cur->position);
            cur=cur->next;
        }
    }
    */
    char list[N][11];
    int where[N];
    int nl=0;
    for(i=0;i<M;i++){
        if(table[i]!=NULL){
            struct node * cur = table[i];
            while(cur!=NULL){
                strcpy(list[nl],cur->data);
                where[nl]=cur->position;
                nl++;
                cur=cur->next;
            }
        }
    }
    /*
    for(i=0;i<nl;i++){
        printf("%s %d;",list[i],where[i]);
    }
    printf("\n");
    */

    //sort
    //使用countsort更方便
    int count[N];
    for(i=0;i<N;i++){
        count[i]=-1;
    }
    for(i=0;i<nl;i++){
        count[where[i]]=i;
    }
    int pos[N];
    int np=0;
    for(i=N-1;i>=0;i--){
        if(count[i]!=-1){
            pos[np]=count[i];
            np++;
        }
    }
    for(i=0;i<nl;i++){
        printf("%s\n",list[pos[i]]);
    }

    //先用最慢速的方式实现，再加快速度！

    return 0;
}


//另一个想法是利用hash
//a~z 0~25
//aa~zz
//aa->0
//ab->1
//az->25
//ba->26
//bb->27
//zz->25*26+25
//zzz->26*26*25+25*26+25
//zz...z->(26^9*25+25*26^8+...+25)
//26^10太大了
//另一个想法是：
//建立hashtable，对hashtable进行sort！
//记录name出现的最大位置
//选择一个hash function
//建立hashtable
//同时记录每一个table的最大出现位置。
//最后根据最大出现位置排序hash table
#define N 200001
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define M 10000
int hash(char *s){
    int hash=0;
    int R=19;
    int i;
    for(i=0;s[i]!='\0';i++){
        hash=(R*hash+s[i])%M;
    }
    return hash;
}
struct node{
    char data[11];
    int position;
    struct node * next;
};
struct node * table[M];
int main() {
    int n;
    scanf("%d",&n);
    //我用hash与hash table来减少查找时间！
    int i;
    for(i=0;i<M;i++){
        table[i]=NULL;
    }
    for(i=0;i<n;i++){
        char name[11];
        scanf("%s",name);
        int h=hash(name);
        //printf("hash %s = %d\n",name,h);
        if(table[h]==NULL){
            table[h]=malloc(sizeof(struct node));
            if(table[h]==NULL){
                printf("未分配到内存\n");
                exit(1);
            }
            strcpy(table[h]->data,name);
            table[h]->position=i;
            table[h]->next=NULL;
        }else{
            int find=0;
            struct node * cur = table[h];
            while(cur!=NULL){
                if(strcmp(cur->data,name)==0){
                    cur->position=i;//对位置进行一个更新
                    find=1;
                    break;
                }
                cur=cur->next;
            }
            if(!find){
                struct node * new=malloc(sizeof(struct node));
                if(new==NULL){
                    printf("未分配到内存\n");
                    exit(1);
                }
                strcpy(new->data,name);
                new->position=i;
                new->next=table[h];
                table[h]=new;
            }
        }
    }
    /*
    for(i=0;i<M;i++){
        struct node * cur = table[i];
        while(cur!=NULL){
            printf("%s at %d\n",cur->data,cur->position);
            cur=cur->next;
        }
    }
    */
    char list[N][11];
    int where[N];
    int nl=0;
    for(i=0;i<M;i++){
        if(table[i]!=NULL){
            struct node * cur = table[i];
            while(cur!=NULL){
                strcpy(list[nl],cur->data);
                where[nl]=cur->position;
                nl++;
                cur=cur->next;
            }
        }
    }
    /*
    for(i=0;i<nl;i++){
        printf("%s %d;",list[i],where[i]);
    }
    printf("\n");
    */

    //sort
    int j;
    for(i=0;i<nl-1;i++){
        int max=i;
        for(j=i+1;j<nl;j++){
            if(where[j]>where[max]){
                max=j;
            }
        }
        //printf("max=%d i=%d\n",max,i);
        if(i!=max){
        int tmp=where[max];
        where[max]=where[i];
        where[i]=tmp;
        char t[11];
        strcpy(t,list[max]);
        strcpy(list[max],list[i]);
        strcpy(list[i],t);
        }
    }
    for(i=0;i<nl;i++){
        printf("%s\n",list[i]);
    }

    //先用最慢速的方式实现，再加快速度！

    return 0;
}


#define N 200001
#include<stdio.h>
#include<string.h>
int main() {
    char name[N][11];
    char see[N][11];
    int nsee=0;
    int n;
    scanf("%d",&n);
    //我用hash与hash table来减少查找时间！
    int i,j;
    for(i=0;i<n;i++){
        scanf("%s",name[i]);
    }
    for(i=n-1;i>=0;i--){
        int find=0;
        for(j=0;j<nsee;j++){
            if(strcmp(name[i],see[j])==0){
                find=1;
                break;
            }
        }
        if(!find){
            printf("%s\n",name[i]);
            strcpy(see[nsee],name[i]);
            nsee++;
        }
    }
	return 0;
}


//另一个想法是利用hash
//a~z 0~25
//aa~zz
//aa->0
//ab->1
//az->25
//ba->26
//bb->27
//zz->25*26+25
//zzz->26*26*25+25*26+25
//zz...z->(26^9*25+25*26^8+...+25)
//26^10太大了
//另一个想法是：
//建立hashtable，对hashtable进行sort！
//记录name出现的最大位置
//选择一个hash function
//建立hashtable
//同时记录每一个table的最大出现位置。
//最后根据最大出现位置排序hash table
#define N 200001
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define M 10
int hash(char *s){
    int hash=0;
    int R=19;
    int i;
    for(i=0;s[i]!='\0';i++){
        hash=(R*hash+s[i])%M;
    }
    return hash;
}
struct node{
    char data[11];
    int position;
    struct node * next;
};
struct node * table[M];
int main() {
    int n;
    scanf("%d",&n);
    //我用hash与hash table来减少查找时间！
    int i;
    for(i=0;i<M;i++){
        table[i]=NULL;
    }
    for(i=0;i<n;i++){
        char name[11];
        scanf("%s",name);
        int h=hash(name);
        //printf("hash %s = %d\n",name,h);
        if(table[h]==NULL){
            table[h]=malloc(sizeof(struct node));
            if(table[h]==NULL){
                printf("未分配到内存\n");
                exit(1);
            }
            strcpy(table[h]->data,name);
            table[h]->position=i;
            table[h]->next=NULL;
        }else{
            int find=0;
            struct node * cur = table[h];
            while(cur!=NULL){
                if(strcmp(cur->data,name)==0){
                    cur->position=i;//对位置进行一个更新
                    find=1;
                    break;
                }
                cur=cur->next;
            }
            if(!find){
                struct node * new=malloc(sizeof(struct node));
                if(new==NULL){
                    printf("未分配到内存\n");
                    exit(1);
                }
                strcpy(new->data,name);
                new->position=i;
                new->next=table[h];
                table[h]=new;
            }
        }
    }
    /*
    for(i=0;i<M;i++){
        struct node * cur = table[i];
        while(cur!=NULL){
            printf("%s at %d\n",cur->data,cur->position);
            cur=cur->next;
        }
    }
    */
    char list[N][11];
    int where[N];
    int nl=0;
    for(i=0;i<M;i++){
        if(table[i]!=NULL){
            struct node * cur = table[i];
            while(cur!=NULL){
                strcpy(list[nl],cur->data);
                where[nl]=cur->position;
                nl++;
                cur=cur->next;
            }
        }
    }
    /*
    for(i=0;i<nl;i++){
        printf("%s %d;",list[i],where[i]);
    }
    printf("\n");
    */

    //sort
    int j;
    for(i=0;i<nl-1;i++){
        int max=i;
        for(j=i+1;j<nl;j++){
            if(where[j]>where[max]){
                max=j;
            }
        }
        //printf("max=%d i=%d\n",max,i);
        if(i!=max){
        int tmp=where[max];
        where[max]=where[i];
        where[i]=tmp;
        char t[11];
        strcpy(t,list[max]);
        strcpy(list[max],list[i]);
        strcpy(list[i],t);
        }
    }
    for(i=0;i<nl;i++){
        printf("%s\n",list[i]);
    }

    //先用最慢速的方式实现，再加快速度！

    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct Nodo{struct Nodo *izq;
                    int v;
                    struct Nodo *der;
                    }Nodo;
Nodo Head;
Nodo *head=&Head;
char t[200020][11];
int see(Nodo *h,int i);
void put(Nodo *h,int i);
int main(){
    int i,j,r,n;
    scanf("%d",&n);
    scanf("%s",t[0]);
    for(i=1;i<n;i++){
        scanf("%s",t[i]);
    }
    Head.v=n-1;
    printf("%s\n",t[n-1]);
    for(i=n-2;~i;i--){
        if(!see(head,i)){
            printf("%s\n",t[i]);
        }
    }
    return 0;
}
int see(Nodo *h,int i){
    int l=strcmp(t[i],t[h->v]);
    if(l<0){
        if(h->izq){
            return see(h->izq,i);
        }else{
            put(head,i);
            return 0;
        }
    }else if(l>0){
        if(h->der){
            return see(h->der,i);
        }else{
            put(head,i);
            return 0;
        }
    }else{
        return 1;
    }
}
void put(Nodo *h,int i){
    int l=strcmp(t[i],t[h->v]);
    if(l<0){
        if(h->izq){
            put(h->izq,i);
        }else{
            h->izq=(Nodo *)calloc(1,sizeof(Nodo));
            h->izq->v=i;
        }
    }else{
        if(h->der){
            put(h->der,i);
        }else{
            h->der=(Nodo *)calloc(1,sizeof(Nodo));
            h->der->v=i;
        }
    }
}


#include<stdio.h>
#include<string.h>
typedef struct Nodo{struct Nodo *izq;
                    int v;
                    struct Nodo *der;
                    }Nodo;
Nodo Head;
Nodo *head=&Head;
char t[200020][11];
int see(Nodo *h,int i);
void put(Nodo *h,int i);
int main(){
    int i,j,r,n;
    scanf("%d",&n);
    scanf("%s",t[0]);
    Head.v=0;
    for(i=j=r=1;i<n;i++){
        scanf("%s",t[j]);
        if(!see(head,j)){
            r++;
            j++;
        }
    }
    printf("%d",r);
    return 0;
}
int see(Nodo *h,int i){
    int l=strcmp(t[i],t[h->v]);
    if(l<0){
        if(h->izq){
            return see(h->izq,i);
        }else{
            put(head,i);
            return 0;
        }
    }else if(l>0){
        if(h->der){
            return see(h->der,i);
        }else{
            put(head,i);
            return 0;
        }
    }else{
        return 1;
    }
}
void put(Nodo *h,int i){
    int l=strcmp(t[i],t[h->v]);
    if(l<0){
        if(h->izq){
            put(h->izq,i);
        }else{
            h->izq=(Nodo *)calloc(1,sizeof(Nodo));
            h->izq->v=i;
        }
    }else{
        if(h->der){
            put(h->der,i);
        }else{
            h->der=(Nodo *)calloc(1,sizeof(Nodo));
            h->der->v=i;
        }
    }
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct node{
  char *word;
  struct node *next;
};

typedef struct node *node_t;

int exist(node_t node, char *word){
  int result = 0;
  node_t aux = node;
  while(aux != NULL && !result){
    if(strcmp(aux->word, word) == 0){
      result = 1;
    }
    else{
      aux = aux->next;
    }
  }
  return result;
}

node_t add_word(char *word, node_t node){
  if(node == NULL){
    node = calloc(1, sizeof(struct node));
    node->word = word;
    node->next = NULL;
  }
  else{
    node_t aux = node;
    while(aux->next != NULL){
      aux = aux->next;
    }
    node_t new = calloc(1, sizeof(struct node));
    new->word = word;
    new->next = NULL;
    aux->next = new;
  }
  return node;
}

void print(node_t node){
  if(node != NULL){
    node_t aux = node;
	  while(aux != NULL){
		  printf("%s\n", aux->word);
      aux = aux->next;
	  }
  }
}

void free_node(node_t node){
  node_t aux = node;
  node_t aux2;
  while(aux != NULL){
    aux2 = aux;
    aux = aux->next;
    free(aux2);
  }
}

int main(){
  int n;
  node_t talked = NULL;
  scanf("%d", &n);
  char words[n][11];
  for(int i = 0; i < n; i++){
    scanf("%s", words[i]);
  }
  for(int i = n - 1; i >= 0; i--){
    if(!exist(talked, words[i])){
      talked = add_word(words[i], talked);
      printf("%s\n", words[i]);
    }
  }
//  free_node(talked);
  return 0;
}


#include <stdio.h>
#include <string.h>

int main(){
  int n, found;
  scanf("%d", &n);
  char words[n][11];
  for(int i = 0; i < n; i++){
    scanf("%s", words[i]);
  }
  for(int i = n - 1; i >= 0; i--){
    found = 0;
    for(int j = i + 1; !found && j < n; j++){
      if(strcmp(words[i], words[j]) == 0){
        found = 1;
      }
    }
    if(!found){
      printf("%s\n", words[i]);
    }
  }
  return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct node{
  char *word;
  struct node *next;
};

typedef struct node *node_t;

int exist(node_t node, char *word){
  int result = 0;
  node_t aux = node;
  while(aux != NULL && !result){
    if(strcmp(aux->word, word) == 0){
      result = 1;
    }
    else{
      aux = aux->next;
    }
  }
  return result;
}

node_t add_word(char *word, node_t node){
  if(node == NULL){
    node = calloc(1, sizeof(struct node));
    node->word = word;
    node->next = NULL;
  }
  else{
    node_t aux = node;
    while(aux->next != NULL){
      aux = aux->next;
    }
    node_t new = calloc(1, sizeof(struct node));
    new->word = word;
    new->next = NULL;
    aux->next = new;
  }
  return node;
}

void print(node_t node){
  if(node != NULL){
    node_t aux = node;
	  while(aux != NULL){
		  printf("%s\n", aux->word);
      aux = aux->next;
	  }
  }
}

void free_node(node_t node){
  node_t aux = node;
  node_t aux2;
  while(aux != NULL){
    aux2 = aux;
    aux = aux->next;
    free(aux2);
  }
}

int main(){
  int n;
  node_t talked = NULL;
  scanf("%d", &n);
  char words[n][10];
  for(int i = 0; i < n; i++){
    scanf("%s", words[i]);
  }
  for(int i = n - 1; i >= 0; i--){
    if(!exist(talked, words[i])){
      talked = add_word(words[i], talked);
    }
  }
  print(talked);
  free_node(talked);
  return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct node{
  char *word;
  struct node *next;
};

typedef struct node *node_t;

int exist(node_t node, char *word){
  int result = 0;
  node_t aux = node;
  while(aux != NULL && !result){
    if(strcmp(aux->word, word) == 0){
      result = 1;
    }
    else{
      aux = aux->next;
    }
  }
  return result;
}

node_t add_word(char *word, node_t node){
  if(node == NULL){
    node = calloc(1, sizeof(struct node));
    node->word = word;
    node->next = NULL;
  }
  else{
    node_t aux = node;
    while(aux->next != NULL){
      aux = aux->next;
    }
    node_t new = calloc(1, sizeof(struct node));
    new->word = word;
    new->next = NULL;
    aux->next = new;
  }
  return node;
}

void print(node_t node){
  if(node != NULL){
    node_t aux = node;
	  while(aux != NULL){
		  printf("%s\n", aux->word);
      aux = aux->next;
	  }
  }
}

void free_node(node_t node){
  node_t aux = node;
  node_t aux2;
  while(aux != NULL){
    aux2 = aux;
    aux = aux->next;
    free(aux2);
  }
}

int main(){
  int n;
  node_t talked = NULL;
  scanf("%d", &n);
  char words[n][11];
  for(int i = 0; i < n; i++){
    scanf("%s", words[i]);
  }
  for(int i = n - 1; i >= 0; i--){
    if(!exist(talked, words[i])){
      talked = add_word(words[i], talked);
    }
  }
  print(talked);
  free_node(talked);
  return 0;
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		Stack<String> stk=new Stack<>();
		Map<String,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    stk.push(in.next());
		}
		for(int i=0;i<n;i++)
		{
		    String s=stk.pop();
		    if(!map.containsKey(s))
		    {
		        map.put(s,0);
		        System.out.println(s);
		    }
		}
	}
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		Stack<String> stk=new Stack<>();
		for(int i=0;i<n;i++)
		{
		    String s=in.next();
		    if(!stk.contains(s))
		    {
		        stk.push(s);
		    }
		    else
		    {
		        stk.remove(s);
		        stk.push(s);
		    }
		}
		while(!stk.empty())
		{
		    System.out.println(stk.pop());
		}
	}
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class S {
	public static void main (String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		LinkedList<String> ll=new LinkedList<>();
		Map<String,Integer> map=new HashMap<>();
		for(int i=0;i<n;i++)
		{
		    String s=in.next();
		    if(!map.containsKey(s))
		    {
		        map.put(s,0);
		        ll.addFirst(s);
		    }
		    else
		    {
		        ll.remove(s);
		        ll.addFirst(s);
		    }
		}
		for(int i=0;i<ll.size();i++)System.out.println(ll.get(i));
	}
}


//package code;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.awt.Point;
/**
 *
 * @author prabhat // use stringbuilder,TreeSet, priorityQueue, x+y=(x&y + x|y);
 */                                                           //X+y=2*(x&y)+ x^y;
  public class  a
   {
   public static int n,max1=2000005,k,m,q,a[],a1[],mat[][],id,depth[],parent[][],len=22,tin[],tout[],count=0,size[],sum,cnt;
   public static Point[] p1,p2,p;
   public static long mod=(long)1e9+7,nCr[][],suf[][],ans=0,max=Long.MIN_VALUE,dp[],l,r;
   public static boolean isPrime[],visit[][],valid[][];
   public static HashSet<Integer> hash;
   public static PriorityQueue<Integer> pq[];
   public static  ArrayList<Integer> divisor[],prime,adj[],lpf,list[],pri;
   //public static ArrayList<Character> list[];
   public static  TreeMap<Integer,Integer> tmap[];
   public static String s;
   //public static pair[] pa;
   public  static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   static PrintWriter pw;
   static int[] x={-1,0,1},y={1,0,-1};

   public static void main(String[] args) throws IOException
   {
	InputReader in = new InputReader(System.in);
	pw=new PrintWriter(System.out);
	int n=in.ii();
    String[] s=in.isa(n);
    LinkedHashSet<String> l=new LinkedHashSet<>();
    for(int i=n-1;i>=0;i--)
    {
    	l.add(s[i]);
    }
    for(String s1:l)pw.println(s1);
	pw.close();
   }

  static boolean va(int x,int y,boolean[][] m)
  {
  	return x>=0&&x<n&&y>=0&&y<n&&!m[x][y];
  }
  static int gcd1(int x,int y)
  {
    if(x==0)return y;
    else if(y==0)return x;
    else return gcd(y,x%y);
  }

 static class pair1{
	 int node;
	 int time;
	 pair1(int s,int v)
	 {
	 	node=s;
	 	time=v;
	 }
 }
static int lowerBound(ArrayList<Integer> al,int tar)
{
	   int s=0;
	   int e=al.size()-1;
	   int ans=0;
	   while(s<=e)
	   {
		   int mid=(s+e)/2;
		   if(al.get(mid)<=tar){s=mid+1;ans=mid+1;}
		   else e=mid-1;
	   }
	   return ans;
}

static boolean isVowel(char c)
{
	return c=='a'||c=='e'||c=='i'||c=='o'||c=='u';
}

public  static class DSU
{
	int[] parent;
	int[] rank;

	int cnt;
	public DSU(int n){
		parent=new int[n];
		rank=new int[n];
		for(int i=0;i<n;i++){
			parent[i]=i;
			rank[i]=1;
		}
		cnt=n;
	}
	int find(int i){
		while(parent[i] !=i){
			parent[i]=parent[parent[i]];
			i=parent[i];
		}
		return i;
	}
	void Union(int x, int y){
		int xset = find(x);
		int yset = find(y);
		if(xset!=yset)
			cnt--;

		if(rank[xset]>rank[yset])
		{
			parent[yset] = xset;
		    rank[xset]+=rank[yset];
			rank[yset]=0;
			//return xset;
		}else{
			parent[xset]=yset;
			rank[yset]+=rank[xset];
			rank[xset]=0;
			//return yset;
		}

     return;
	}
}

 static int palin(String s)
 {
	String s1=new StringBuilder(s).reverse().toString();
	return s1.equals(s)==true?1:0;
 }
 /*static int dfs(int u, int p) {

	//discover[count1++]=arr[u];  //  it storing color or arr of vertex u
	//discover[count1++]=u;
	//tin[u] = count++;
   int d1=1000000;
   int d2=1000000;
   int cnt=0;
	//parent[u][0] = p==-1?0:p;
	//size[u]++;
	//for (int i = 1; i < len; i++)
	//	parent[u][i] = parent[parent[u][i-1]][i-1];
	for (int v :adj[u])
		if (v != p)
		{
			cnt++;
			depth[v] = depth[u] + 1;
			int y=dfs( v, u);
			if(y<d1)
			{
				d2=d1;
				d1=y;
			}
			else if(y<d2)
			{
				d2=y;
			}
	//		size[u] += size[v];
		}
	if(cnt==0)return 1;
	ans=Math.min(d1+d2,ans);
	return 1+Math.min(d1,d2);
//	if(adj[u].size()==1&&parent[u][0]!=0)last.add(u);
//	tout[u] = count-1;
}
*/

static boolean isParent(int parent, int child) {
	return tin[parent] <= tin[child] && tout[child] <= tout[parent];
}

static int lca(int a, int b) {
	if (isParent(a, b))
		return a;
	if (isParent(b, a))
		return b;
	for (int i = len - 1; i >= 0; i--)
		if (!isParent(parent[a][i], b))
			a = parent[a][i];
	return parent[a][0];
}
static boolean valid(int i,int j)
{
	return i>=0&&i<3&&j>=0&&j<3;
}

static int gcd(int a,int b)
{
	while(a!=0)
	{
		int temp=a;
		a=b%a;
		b=temp;
	}
	return b;
}
static void Seive()
{
	a1=new int[max1];
	isPrime=new boolean[max1];
	Arrays.fill(isPrime,true);
	prime=new ArrayList<>();
	divisor=new ArrayList[max1];
	for(int i=1;i<max1;i++)divisor[i]=new ArrayList<Integer>();
    isPrime[0]=isPrime[1]=false;
	for(int i=2;i<(max1);i++)
	{
         if(isPrime[i]){
			 divisor[i].add(i);
			 prime.add(i);
			 a1[i]=1;
			for(int j=2*i;j<max1;j+=i)
			{
				a1[j]++;
				isPrime[j]=false;
				divisor[j].add(i);
			}
		}
	}
}
public static long pow(long n,long p)
{
	 long  result = 1;
	  if(p==0)
	    return 1;

	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;

	    p >>=1;
	    n*=n;
	}
	return result;
}

static  class InputReader
{
   private InputStream stream;
   private byte[] buf = new byte[1024];

   private SpaceCharFilter filter;
    byte inbuffer[] = new byte[1024];
   int lenbuffer = 0, ptrbuffer = 0;
    final int M = (int) 1e9 + 7;
   int md=(int)(1e7+1);
    int[] SMP=new int[md];
   final double eps = 1e-6;
   final double pi = Math.PI;

	PrintWriter out;
   String check = "";
 InputStream   obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
   public InputReader(InputStream stream)
   {
       this.stream = stream;
   }

    int readByte() {
	        if (lenbuffer == -1) throw new InputMismatchException();
	        if (ptrbuffer >= lenbuffer) {
	            ptrbuffer = 0;
	            try {
	                lenbuffer = obj.read(inbuffer);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	        }
	        if (lenbuffer <= 0) return -1;
	        return inbuffer[ptrbuffer++];
   }

   public  int read()
   {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       int sgn = 1;
       if (c == '-')
       {
           sgn = -1;
           c = read();
       }
       int res = 0;
       do
       {
           if (c < '0' || c > '9')
               throw new InputMismatchException();
           res *= 10;
           res += c - '0';
           c = read();
       } while (!isSpaceChar(c));
       return res * sgn;
   }

   String is() {
	        int b = skip();
	        StringBuilder sb = new StringBuilder();
	        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
	        {
	            sb.appendCodePoint(b);
	            b = readByte();
	        }
	        return sb.toString();
   }
   public   int ii() {
	        int num = 0, b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }
 public   long il() {
	        long num = 0;
	        int b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }

	    boolean isSpaceChar(int c) {
	        return (!(c >= 33 && c <= 126));
	       }

	      int skip()
	        {
	        int b;
	        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
	        return b;
	        }

	    float nf() {
	        return Float.parseFloat(is());
	    }

	    double id() {
	        return Double.parseDouble(is());
	    }

	    char ic() {
	        return (char) skip();
	    }

	    int[] iia(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i<n; i++) a[i] = ii();
	        return a;
	    }

	    long[] ila(int n) {
	        long a[] = new long[n];
	        for (int i = 0; i <n; i++) a[i] = il();
	        return a;
	    }

	    String[] isa(int n) {
	        String a[] = new String[n];
	        for (int i = 0; i < n; i++) a[i] = is();
	        return a;
	    }

		 long mul(long a, long b) { return a * b % M; }

		/*	long div(long a, long b)
				 {
					return mul(a, pow(b, M - 2,M));

		           }
*/

	    double[][] idm(int n, int m) {
	        double a[][] = new double[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
	        return a;
	        }

	    int[][] iim(int n, int m) {
	        int a[][] = new int[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j <m; j++) a[i][j] = ii();
	        return a;
          }

   public String readLine() {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       StringBuilder res = new StringBuilder();
       do {
           res.appendCodePoint(c);
           c = read();
       } while (!isEndOfLine(c));
       return res.toString();
   }

   public interface SpaceCharFilter
   {
       public boolean isSpaceChar(int ch);
   }
   public boolean isEndOfLine(int c) {
       return c == '\n' || c == '\r' || c == -1;
   }
}

}


//package code;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.awt.Point;
/**
 *
 * @author prabhat // use stringbuilder,TreeSet, priorityQueue, x+y=(x&y + x|y);
 */                                                           //X+y=2*(x&y)+ x^y;
  public class  a
   {
   public static int n,max1=2000005,k,m,q,a[],a1[],mat[][],id,depth[],parent[][],len=22,tin[],tout[],count=0,size[],sum,cnt;
   public static Point[] p1,p2,p;
   public static long mod=(long)1e9+7,nCr[][],suf[][],ans=0,max=Long.MIN_VALUE,dp[],l,r;
   public static boolean isPrime[],visit[][],valid[][];
   public static HashSet<Integer> hash;
   public static PriorityQueue<Integer> pq[];
   public static  ArrayList<Integer> divisor[],prime,adj[],lpf,list[],pri;
   //public static ArrayList<Character> list[];
   public static  TreeMap<Integer,Integer> tmap[];
   public static String s;
   //public static pair[] pa;
   public  static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
   static PrintWriter pw;
   static int[] x={-1,0,1},y={1,0,-1};

   public static void main(String[] args) throws IOException
   {
	InputReader in = new InputReader(System.in);
	pw=new PrintWriter(System.out);
	int n=in.ii();
    String[] s=in.isa(n);
    LinkedList<String> l=new LinkedList<>();
    for(int i=n-1;i>=0;i--)
    {
    	if(!l.contains(s[i]))l.add(s[i]);
    }
    for(String s1:l)pw.println(s1);
	pw.close();
   }

  static boolean va(int x,int y,boolean[][] m)
  {
  	return x>=0&&x<n&&y>=0&&y<n&&!m[x][y];
  }
  static int gcd1(int x,int y)
  {
    if(x==0)return y;
    else if(y==0)return x;
    else return gcd(y,x%y);
  }

 static class pair1{
	 int node;
	 int time;
	 pair1(int s,int v)
	 {
	 	node=s;
	 	time=v;
	 }
 }
static int lowerBound(ArrayList<Integer> al,int tar)
{
	   int s=0;
	   int e=al.size()-1;
	   int ans=0;
	   while(s<=e)
	   {
		   int mid=(s+e)/2;
		   if(al.get(mid)<=tar){s=mid+1;ans=mid+1;}
		   else e=mid-1;
	   }
	   return ans;
}

static boolean isVowel(char c)
{
	return c=='a'||c=='e'||c=='i'||c=='o'||c=='u';
}

public  static class DSU
{
	int[] parent;
	int[] rank;

	int cnt;
	public DSU(int n){
		parent=new int[n];
		rank=new int[n];
		for(int i=0;i<n;i++){
			parent[i]=i;
			rank[i]=1;
		}
		cnt=n;
	}
	int find(int i){
		while(parent[i] !=i){
			parent[i]=parent[parent[i]];
			i=parent[i];
		}
		return i;
	}
	void Union(int x, int y){
		int xset = find(x);
		int yset = find(y);
		if(xset!=yset)
			cnt--;

		if(rank[xset]>rank[yset])
		{
			parent[yset] = xset;
		    rank[xset]+=rank[yset];
			rank[yset]=0;
			//return xset;
		}else{
			parent[xset]=yset;
			rank[yset]+=rank[xset];
			rank[xset]=0;
			//return yset;
		}

     return;
	}
}

 static int palin(String s)
 {
	String s1=new StringBuilder(s).reverse().toString();
	return s1.equals(s)==true?1:0;
 }
 /*static int dfs(int u, int p) {

	//discover[count1++]=arr[u];  //  it storing color or arr of vertex u
	//discover[count1++]=u;
	//tin[u] = count++;
   int d1=1000000;
   int d2=1000000;
   int cnt=0;
	//parent[u][0] = p==-1?0:p;
	//size[u]++;
	//for (int i = 1; i < len; i++)
	//	parent[u][i] = parent[parent[u][i-1]][i-1];
	for (int v :adj[u])
		if (v != p)
		{
			cnt++;
			depth[v] = depth[u] + 1;
			int y=dfs( v, u);
			if(y<d1)
			{
				d2=d1;
				d1=y;
			}
			else if(y<d2)
			{
				d2=y;
			}
	//		size[u] += size[v];
		}
	if(cnt==0)return 1;
	ans=Math.min(d1+d2,ans);
	return 1+Math.min(d1,d2);
//	if(adj[u].size()==1&&parent[u][0]!=0)last.add(u);
//	tout[u] = count-1;
}
*/

static boolean isParent(int parent, int child) {
	return tin[parent] <= tin[child] && tout[child] <= tout[parent];
}

static int lca(int a, int b) {
	if (isParent(a, b))
		return a;
	if (isParent(b, a))
		return b;
	for (int i = len - 1; i >= 0; i--)
		if (!isParent(parent[a][i], b))
			a = parent[a][i];
	return parent[a][0];
}
static boolean valid(int i,int j)
{
	return i>=0&&i<3&&j>=0&&j<3;
}

static int gcd(int a,int b)
{
	while(a!=0)
	{
		int temp=a;
		a=b%a;
		b=temp;
	}
	return b;
}
static void Seive()
{
	a1=new int[max1];
	isPrime=new boolean[max1];
	Arrays.fill(isPrime,true);
	prime=new ArrayList<>();
	divisor=new ArrayList[max1];
	for(int i=1;i<max1;i++)divisor[i]=new ArrayList<Integer>();
    isPrime[0]=isPrime[1]=false;
	for(int i=2;i<(max1);i++)
	{
         if(isPrime[i]){
			 divisor[i].add(i);
			 prime.add(i);
			 a1[i]=1;
			for(int j=2*i;j<max1;j+=i)
			{
				a1[j]++;
				isPrime[j]=false;
				divisor[j].add(i);
			}
		}
	}
}
public static long pow(long n,long p)
{
	 long  result = 1;
	  if(p==0)
	    return 1;

	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;

	    p >>=1;
	    n*=n;
	}
	return result;
}

static  class InputReader
{
   private InputStream stream;
   private byte[] buf = new byte[1024];

   private SpaceCharFilter filter;
    byte inbuffer[] = new byte[1024];
   int lenbuffer = 0, ptrbuffer = 0;
    final int M = (int) 1e9 + 7;
   int md=(int)(1e7+1);
    int[] SMP=new int[md];
   final double eps = 1e-6;
   final double pi = Math.PI;

	PrintWriter out;
   String check = "";
 InputStream   obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
   public InputReader(InputStream stream)
   {
       this.stream = stream;
   }

    int readByte() {
	        if (lenbuffer == -1) throw new InputMismatchException();
	        if (ptrbuffer >= lenbuffer) {
	            ptrbuffer = 0;
	            try {
	                lenbuffer = obj.read(inbuffer);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	        }
	        if (lenbuffer <= 0) return -1;
	        return inbuffer[ptrbuffer++];
   }

   public  int read()
   {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       int sgn = 1;
       if (c == '-')
       {
           sgn = -1;
           c = read();
       }
       int res = 0;
       do
       {
           if (c < '0' || c > '9')
               throw new InputMismatchException();
           res *= 10;
           res += c - '0';
           c = read();
       } while (!isSpaceChar(c));
       return res * sgn;
   }

   String is() {
	        int b = skip();
	        StringBuilder sb = new StringBuilder();
	        while (!(isSpaceChar(b))) // when nextLine, (isSpaceChar(b) && b!=' ')
	        {
	            sb.appendCodePoint(b);
	            b = readByte();
	        }
	        return sb.toString();
   }
   public   int ii() {
	        int num = 0, b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }
 public   long il() {
	        long num = 0;
	        int b;
	        boolean minus = false;
	        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
	        if (b == '-') {
	            minus = true;
	            b = readByte();
	        }
	        while (true) {
	            if (b >= '0' && b <= '9') {
	                num = num * 10 + (b - '0');
	            } else {
	                return minus ? -num : num;
	            }
	            b = readByte();
	        }
   }

	    boolean isSpaceChar(int c) {
	        return (!(c >= 33 && c <= 126));
	       }

	      int skip()
	        {
	        int b;
	        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
	        return b;
	        }

	    float nf() {
	        return Float.parseFloat(is());
	    }

	    double id() {
	        return Double.parseDouble(is());
	    }

	    char ic() {
	        return (char) skip();
	    }

	    int[] iia(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i<n; i++) a[i] = ii();
	        return a;
	    }

	    long[] ila(int n) {
	        long a[] = new long[n];
	        for (int i = 0; i <n; i++) a[i] = il();
	        return a;
	    }

	    String[] isa(int n) {
	        String a[] = new String[n];
	        for (int i = 0; i < n; i++) a[i] = is();
	        return a;
	    }

		 long mul(long a, long b) { return a * b % M; }

		/*	long div(long a, long b)
				 {
					return mul(a, pow(b, M - 2,M));

		           }
*/

	    double[][] idm(int n, int m) {
	        double a[][] = new double[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) a[i][j] = id();
	        return a;
	        }

	    int[][] iim(int n, int m) {
	        int a[][] = new int[n][m];
	        for (int i = 0; i < n; i++) for (int j = 0; j <m; j++) a[i][j] = ii();
	        return a;
          }

   public String readLine() {
       int c = read();
       while (isSpaceChar(c))
           c = read();
       StringBuilder res = new StringBuilder();
       do {
           res.appendCodePoint(c);
           c = read();
       } while (!isEndOfLine(c));
       return res.toString();
   }

   public interface SpaceCharFilter
   {
       public boolean isSpaceChar(int ch);
   }
   public boolean isEndOfLine(int c) {
       return c == '\n' || c == '\r' || c == -1;
   }
}

}


//package VK_CUP_2016;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.LinkedHashSet;
import java.util.StringTokenizer;

public class B {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	int n=nextInt();
	LinkedHashSet<String>l=new LinkedHashSet<String>();
	String s="";
	for (int i = 1; i <=n; i++) {
		s=next();
		int y=l.size();
		l.add(s);
		if(y==l.size()){
			l.remove(s);
			l.add(s);
		}
	}s="";
	for (String i:l) {
		s=i+"\n"+s;
	}
	pw.print(s);
	pw.close();
}
private static int nextInt() throws IOException {
	return Integer.parseInt(next());
}
private static long nextLong() throws IOException {
	return Long.parseLong(next());
}
private static double nextDouble() throws IOException {
	return Double.parseDouble(next());
}
private static String next() throws IOException {
	while (st==null || !st.hasMoreTokens())
		st = new StringTokenizer(br.readLine());
	return st.nextToken();
}
}


//package VK_CUP_2016;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.StringTokenizer;

public class B {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	int n=nextInt();
	LinkedHashSet<String>l=new LinkedHashSet<String>();
	String s="";
	for (int i = 1; i <=n; i++) {
		s=next();
		l.remove(s);
		l.add(s);
	}s="";
	for (String i:l) {
		s=i+"\n"+s;
	}
	pw.print(s);
	pw.close();
}
private static int nextInt() throws IOException {
	return Integer.parseInt(next());
}
private static long nextLong() throws IOException {
	return Long.parseLong(next());
}
private static double nextDouble() throws IOException {
	return Double.parseDouble(next());
}
private static String next() throws IOException {
	while (st==null || !st.hasMoreTokens())
		st = new StringTokenizer(br.readLine());
	return st.nextToken();
}
}


//package VK_CUP_2016;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class B {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	int n=nextInt();
	String []a=new String[n];
	for (int i = 0; i < a.length; i++) {
		a[i]=next();
	}
	TreeSet<String>st=new  TreeSet<String>();
	int y=0;
	for (int i =n-1; i >=0; i--) {
		y=st.size();
		st.add(a[i]);
		if(st.size()!=y){
			pw.println(a[i]);
		}
	}
	pw.close();
}
private static int nextInt() throws IOException {
	return Integer.parseInt(next());
}
private static long nextLong() throws IOException {
	return Long.parseLong(next());
}
private static double nextDouble() throws IOException {
	return Double.parseDouble(next());
}
private static String next() throws IOException {
	while (st==null || !st.hasMoreTokens())
		st = new StringTokenizer(br.readLine());
	return st.nextToken();
}
}


//package VK_CUP_2016;

import java.awt.List;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class B {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	int n=nextInt();
	Set<String>mp=new LinkedHashSet<String>();
	String s="";
	for (int i =1; i <=n; i++) {
		s=next();
		mp.remove(s);
		mp.add(s);
	}
	String u="";

	for(String i:mp){
		u=i+"\n"+u;

	}
	pw.print(u);
	pw.close();
}
private static int nextInt() throws IOException {
	return Integer.parseInt(next());
}
private static long nextLong() throws IOException {
	return Long.parseLong(next());
}
private static double nextDouble() throws IOException {
	return Double.parseDouble(next());
}
private static String next() throws IOException {
	while (st==null || !st.hasMoreTokens())
		st = new StringTokenizer(br.readLine());
	return st.nextToken();
}
}


//package Acmp_ru;

import java.util.List;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class B {
	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = nextInt();
		List<String> list = new LinkedList<String>();
		List<String> listItem = new LinkedList<String>();
		int i = 1;
		for (; i <= n; i++){
			list.add(0,next());
		}
		for (String item : list){
			if (!listItem.contains(item)){
				pw.println(item);
				listItem.add(item);
			}
		}
	pw.close();
}
private static int nextInt() throws IOException {
	return Integer.parseInt(next());
}
private static long nextLong() throws IOException {
	return Long.parseLong(next());
}
private static double nextDouble() throws IOException {
	return Double.parseDouble(next());
}
private static String next() throws IOException {
	while (st==null || !st.hasMoreTokens())
		st = new StringTokenizer(br.readLine());
	return st.nextToken();
}
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        ArrayList<String> arr = new ArrayList<>(n);
        for(int i=0;i<n;i++){
        	String x = sc.next().toLowerCase();
        	if(arr.contains(x));{
        		arr.remove(x);
        	}
        	arr.add(x);

        }
        for(int j=arr.size()-1 ;j>=0;j--)
        	out.println(arr.get(j));
        out.flush();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        HashSet<String> arr = new HashSet<String>();
        String[] arr2 = new String[n];
        for(int i=0 ;i<n;i++)
        	arr2[i]=sc.nextLine();

        for(int i =n-1 ;i>=0 ;i--){
        	if(!arr.contains(arr2[i])){
        		out.println(arr2[i]);
        		arr.add(arr2[i]);
        	}
        }
        out.flush();
    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
        public Scanner(String file) throws Exception {br = new BufferedReader(new FileReader(file));}
        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
        public String nextLine()throws IOException{return br.readLine();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
        public char nextChar()throws IOException{return next().charAt(0);}
        public Long nextLong()throws IOException{return Long.parseLong(next());}
        public boolean ready() throws IOException{return br.ready();}
        public void waitForInput() throws InterruptedException {Thread.sleep(3000);}
    }
}