#include <bits/stdc++.h>
using namespace std;
const int N = 100 ;
int a[N] ;
int main() {
int n ;
cin>>n ;
int frq[101] = {} ;
for(int i = 0 ; i < n ; i++) /// O(n)
{
cin >> a[i];
frq[a[i]]++ ;
}
for(int i = 0 ; i < n ; i++)
{
if(frq[a[i]] > 1)
{
cout<<a[i]<<' ' ;
frq[a[i]] = 0 ;
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBOID0gMTAwIDsKaW50IGFbTl0gOwppbnQgbWFpbigpIHsKICAgIGludCBuIDsKICAgIGNpbj4+biA7CiAgICBpbnQgZnJxWzEwMV0gPSB7fSA7CiAgICBmb3IoaW50IGkgPSAwIDsgaSA8IG4gOyBpKyspIC8vLyBPKG4pCiAgICB7CiAgICAgICAgY2luID4+IGFbaV07CiAgICAgICAgZnJxW2FbaV1dKysgOwogICAgfQogICAgZm9yKGludCBpID0gMCA7IGkgPCBuIDsgaSsrKQogICAgewogICAgICAgIGlmKGZycVthW2ldXSA+IDEpCiAgICAgICAgewogICAgICAgICAgICBjb3V0PDxhW2ldPDwnICcgOwogICAgICAgICAgICBmcnFbYVtpXV0gPSAwIDsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQ==