stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<int,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s[maxn];

set<string>S;



int main()

{

    int n,mx=-1;

    scanf("%d",&n);

    for(int i=1;i<=n;i++){

        cin>>s[i];

        MP[s[i]]++;

        S.insert(s[i]);

        mx=max(mx,MP[s[i]]);

    }

    for(auto it=S.begin();it!=S.end();it++){

        if(MP[*it]==mx){

            cout<<*it<<endl;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 8.156464737239407x):
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<string,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s;

vector<pii>v;



int main()

{

    int n,mx=-1,j;

    scanf("%d",&n);

    for(int i=1;i<=n;i++){

        cin>>s;

        mx=max(mx,++MP[s]);

    }

    for(auto it=MP.begin();it!=MP.end();it++){

        j=it->second;

        if(j==mx){

            v.pb(mp(it->first,j));

        }

    }

    sort(v.begin(),v.end());

    for(int i=0;i<v.size();i++){

        cout<<v[i].f<<endl;

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include<algorithm>

#include<string>

#include<vector>

#include<cmath>

#include<map>

#include<limits>

//include<bits/stdc++.h>

using namespace std;

int main()

{

	int N;

	cin >> N;

	map<string, int>frequency;

	int max = 0;

	string tmp;

	vector<string>most_vote;

	for (int i = 0; i < N; i++)

	{

		cin >> tmp;

		if (frequency.find(tmp) != frequency.end())

		{

			frequency[tmp]++;

		}

		else

			frequency[tmp] = 1;

		if (frequency[tmp] > max)

			max = frequency[tmp];

	}

	map<string, int>::iterator it;



	for (it = frequency.begin(); it != frequency.end(); it++)

	{

		if (it->second == max)

			most_vote.push_back(it->first);

	}

	sort(most_vote.begin(), most_vote.end());

	for (int i = 0; i < most_vote.size(); i++)

		cout << most_vote[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.3164500481503385x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define sz(x) ((int)x.size())

#define pb push_back

#define ii pair<int,int>

#define ppb pop_back

#define orta ((bas+son)>>1)

#define st first

#define nd second

#define ll long long

#define N 200005

#define inf 1000000000

#define MOD 1000000007

#define LOG 20

#define EPS 0.000000001

#define M 305

using namespace std;



map<string,int> mp;

int n;

int mx;



int main() {



	ios_base::sync_with_stdio(0);

	cin.tie(0);cout.tie(0);



	cin>>n;

	for(int i=1;i<=n;i++) {

		string s;

		cin>>s;

		mp[s]++;

		mx=max(mx,mp[s]);

	}

	vector<string> a;

	for(auto x:mp) {

		if(x.nd==mx) a.pb(x.st);

	}

	sort(a.begin(),a.end());

	for(auto x:a) 

		cout<<x<<"\n";



}

// Faster C++ solution for the same problem (measured speedup: 5.3287640190952805x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

#define endl              "\n"

#define pb              push_back

#define fir               first

#define sec               second

#define all(v)            ((v).begin()), ((v).end())

#define sz(v)            ((int)((v).size()))

#define ll              long long

#define ld              long double

#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)

#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)

#define isPowerOfTwo(s) (!(s & (s-1)))

typedef vector<int> vi;

typedef deque<int> de;

void origi() {

    ios_base::sync_with_stdio(false);

    cin.tie(nullptr), cout.tie(nullptr);

}

map<string, int>m1;

map<int,string>m2;

void tiranga() {

    int n;

    string s;

    cin >> n;

    lp(i, n) {

        cin >> s;

        m1[s]++;

    }

    int Max = INT_MIN;

    for (auto mm:m1)

        Max = max(Max, mm.second);

    for(auto mm:m1){

        if (mm.second == Max)

            cout << mm.first << endl;

    }



}

int main() {

#ifndef ONLINE_JUDGE

    //freopen("input.txt", "r", stdin);

#else

#endif 

    origi();

    tiranga();

    //cout << sumOfDig(123654);

   // genLarge(10, 10);

   // genSmall(10);

   

}


// Faster C++ solution for the same problem (measured speedup: 5.310395559183151x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



bool fun( string word , string  word_1 )

{

    if( word < word_1 )

        return 1 ;

    else

        return 0 ;

}



int main()

{

    int num;

    cin>>num;

    map<string,int> map_1;

    for(int i=0 ; i<num ; i++)

    {

        string word;

        cin>>word;

        map_1[word]++;

    }

    int max_1=0;

    for( auto it : map_1 )

    {

        max_1=max( max_1  , it.second );

    }

    vector<string> word_1;

    for( auto it : map_1)

    {

        if( it.second == max_1 )

            word_1.push_back( it.first );

    }

    sort( word_1.begin() , word_1.end() , fun );

    for(int i=0 ; i<word_1.size() ; i++)

    {

        cout<<word_1[i]<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.2753089213104305x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

multiset<string>vc;

map<string,int>mp;

int main()

{





    int n;

    cin>>n;

    for(int i=0;i<n;i++){



        string str;

        cin>>str;

        vc.insert(str);



    }

for(auto it=vc.begin(); it!=vc.end();it++ )



       {

           mp[*it]++;

       }

int maxi=0;



for(auto it=mp.begin();it!=mp.end();it++){



maxi=max(it->second,maxi);





}



for(auto it=mp.begin();it!=mp.end();it++){



if(it->second==maxi)cout<<it->first<<endl;}



















    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.303590499720774x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int main() {

    int n, mx = 0;

    cin >> n;

    map<string, int> freq;

    set<string> st;

    for (int i = 0; i < n; ++i) {

        string s;

        cin >> s;

        if (++freq[s] > mx) {

            mx = freq[s];

            st.clear();

            st.insert(s);

        } else if (freq[s] == mx) {

            st.insert(s);

        }

    }

    for (auto s: st) 

        cout << s << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.269315729002603x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#pragma GCC positionimize(3,"Otrst","inline")

//#include "emplace.hpp"

#include<bits/stdc++.h>



using namespace std;

typedef long long ll;

const int N=2e5+10;

const int INF=0x3f3f3f;

const double pi = 3.141592653;

const double E = 2.71828182846;

const ll mod=1e9+7;

const int M=1e4+5;

const double eps=1e-8;

#define ci(x) scanf("%d",&x)

#define co(x) printf("%d\n",x)

inline int read()

{

    int f=1,x=0;

    char c=getchar();

    while(c<'0' || c>'9')

    {

        if(c=='-')

            f=-1;

        c=getchar();

    }

    while(c>='0' && c<='9')

    {

        x=x*10+c-'0';

        c=getchar();

    }

    return f*x;

}

map<string,int>ma;

map<string ,int>::iterator it;

int main()

{

    ios::sync_with_stdio(false);

    int max_fre=0;

    string s;

    int n;

    cin>>n;

    for(int i=0;i<n;i++)

    {

        cin>>s;

        ma[s]++;

        max_fre=max(max_fre,ma[s]);

    }

    for(it=ma.begin();it!=ma.end();it++)

    {

        if(it->second == max_fre)

            cout<<it->first<<endl;

    }

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.317816024975735x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<map>



using namespace std;



map<string, int> cnt;



int main()

{

    int t;

    cin >> t;

    

    int d = 0;

    while(t --)

    {

        string s;

        cin >> s;

        cnt[s] ++;

        d = max(d, cnt[s]);

    }

    

    for(auto p : cnt)

        if(p.second == d)

            cout << p.first << endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.2970503653298815x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

    for(i=0;i<=n-1;i++)

    {

        scanf("%s",s[i]);

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

    for(i=0;i<=n-2;i++)

    {

        if(strcmp(s[i],s[i+1])==0)

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

	for(ll i=0; i<n; i++){

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 8.123728134419991x):
#include <bits/stdc++.h>



#define iPair pair<string,int>



using namespace std;



typedef long long int ll;



bool sortValThenKey(const iPair& a,

	const iPair& b)

{

	if (a.second == b.second) {

		return a.first < b.first;

	}

	return (a.second > b.second);

}



int main()

{

	int t;

	cin >> t;



	vector<iPair> vec;

	map<string,int> store;



	for (int i = 0; i < t; i++) {

		string s;

		cin >> s;

		if (store.find(s) == store.end()) {

			store.insert(make_pair(s, 1));

		}

		else {

			store[s]++;

		}

	}



	for (auto i = store.begin(); i != store.end(); i++) {

		vec.push_back(make_pair(i->first, i->second));

	}

	sort(vec.begin(), vec.end(), sortValThenKey);

	int mxN = vec[0].second;

	for (int i = 0; i < vec.size(); i++) {

		if (vec[i].second == mxN) {

			cout << vec[i].first << endl;

		}

		else {

			break;

		}

	}

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

	for(ll i=0; i<n; i++){

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 8.224692396171303x):
#include <bits/stdc++.h>

using namespace std;



int main() {

    //freopen("../input.txt", "r", stdin);

    long long int N;

    cin >> N;

    map<string, int> freq;

    int highest = 0;

    for (int i = 0; i < N; ++i) {

        string input;

        cin >> input;

        freq[input]++;

        if(freq[input] > highest){

            highest = freq[input];

        }

    }

    //int highest = (*max_element(freq.begin(), freq.end())).second;

    for (auto it = freq.begin(); it != freq.end(); it++) {

        if (it->second == highest) {

            cout << it->first << "\n";

        }

    }

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

	for(ll i=0; i<n; i++){

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 8.228309209117132x):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;



int main(void)

{

    //freopen("input.txt", "r", stdin);



    int i, n;

    cin >> n;

    string a;

    map <string, int> m;

    vector <string> v;



    int cntt = 1;

    for(i = 0; i < n; i++)

    {

        cin >> a;



        auto it = m.find(a);

        if(it != m.end())

        {

            m[a]++;

            if(m[a] > cntt)

                cntt = m[a];

        }

        else

        {

            m.insert(make_pair(a, 1));

        }

    }



    for(auto it = m.begin(); it != m.end(); it++)

    {

        if(it->second == cntt)

            cout << it->first << "\n";

    }



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

	for(ll i=0; i<n; i++){

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 8.091729963053266x):
#include<bits/stdc++.h>

using namespace std;

typedef long long int lli;

#define forn(i,n) for(int i=0;i<(int) n;i++)

#define Forn(i,n) for(int i=1;i<=(int) n;i++)



int main()

{



  int n,i;

  cin>>n;

  map<string,int> mp;

  vector< pair<int,string> > v;

  for(i=0;i<n;i++)

  {

      string s;

      cin>>s;

      mp[s]++;



  }

  map<string,int>:: iterator it;

  for(it=mp.begin();it!=mp.end();it++)

  {

      string a;

      int b;

      a=it->first;

      b=it->second;

      v.push_back(make_pair(b,a));



  }

  int len=v.size();

  set<string> st;

  sort(v.begin(),v.end());

  int t=v[len-1].first;





  for(i=len-1;i>=0;i--)

  {

      //cout<<v[i].first<<' '<<v[i].second<<endl;

      if(v[i].first==t)

      {

          st.insert(v[i].second);

      }

  }



  set<string>:: iterator itt;

  for(itt=st.begin();itt!=st.end();itt++)

  {

      cout<<*itt<<endl;

  }



}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

	for(ll i=0; i<n; i++){

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Faster C++ solution for the same problem (measured speedup: 8.142653570838533x):
#include <bits/stdc++.h>

using namespace std;



int main()

{

    int i, j, n, k=0 ;

    cin >> n ;

    map<string, int> mp;

    while(n--)

    {

        string s ;

        cin >> s ;

        mp[s]++;

        k=max(k,mp[s]);

    }

    for(auto l=mp.begin(); l!=mp.end(); l++)

    {

        if(l->second==k)

            cout << l->first << endl ;

    }



    return 0;

}