#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin("bac.in");
ofstream fout("bac.out");
int n,a[10001],k,l;
int main ()
{
fin >> n;
for(int i=1;i<=n;i++)
fin >> a[i];
sort(a,a+n);
for(int i=1;i<=n;i++)
{
if(i>1 and a[i]==k and l==0)
cout << a[i] << " ", l++;
if(a[i]!=k) l=0;
k=a[i];
}
return 0;
}