stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

using namespace std;

int main()

{

    int n;

    cin>>n;

    map<string,int>mp;

    vector<string>v1,v2;

    string s;

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

    {

        cin>>s;

        if(mp[s]==0) v1.push_back(s);

        mp[s]++;

    }

    int mx=0;

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

    {

        mx=max(mx,mp[v1[i]]);

    }

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

    {

        if(mp[v1[i]]==mx)

            v2.push_back(v1[i]);

    }

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

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

    {

        cout<<v2[i]<<endl;

    }



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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

using  namespace  std;



map<string,long long> mp;

int main() {



    ios_base :: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



    long long n;

    cin>>n;



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

        string name;

        cin>>name;

        mp[name]++;

    }



    long long max = 0;

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

        if(i->second>max){

            max = i->second;

        }

    }



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

        if(i->second==max){

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

        }

    }









    return 0;

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

using namespace std;

typedef long long ll;

int main()

{

    ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);



    int n;



    cin >> n;



    map <string, int> mp;

    map <string, int> :: iterator it;





    while(n--)

    {

        string s;



        cin >> s;



        mp[s]++;



    }



    int mx = INT_MIN;



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

    {

        int z = (*it).second;



        mx = max(mx, z);

    }



    vector <string> v;



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

    {

        if((*it).second == mx)

        {

            v.push_back((*it).first);

        }

    }



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



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

    {

        cout << v[i] << endl;

    }









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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

using namespace std;





int main(void)

{

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    int n, m = -1;

    cin >> n;

    map <string,int> mp;

    string s;

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

    {

        cin >> s;

        mp[s]++;

        if(m < mp[s])

            m = mp[s];

    }

    map<string, int> :: iterator it;

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

    {

        if(it->second == m)

        {

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

        }

    }

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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



using namespace std;



int main(){

	int n;

	cin>>n;

	string s;

	map<string, int> m;

	int maior = 0;

	while(n--){

		cin>>s;

		m[s]++;

		if(m[s] > maior)

			maior = m[s];

	}

	set<string> s1;

	for(auto it: m){

		if(it.second == maior){

			s1.insert(it.first);

		}

	}

	for(auto it: s1){

		cout<<it<<endl;

	}

	

	return 0;

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

#define ll long long

#define vl vector<ll int>

#define vs vector<string>

#define vi vector<int>

#define mi map<int,int>

#define mc map<char,int>



//ios_base::sync_with_stdio(false);cin.tie(NULL);



using namespace std;



int main(){

     ios_base::sync_with_stdio(false);cin.tie(NULL);

     int n,m=1;

     cin>>n;

     vs A(n);

     vs B;

     for(auto &x:A)cin>>x;

     map<string,int> map1;

     for(auto x:A)map1[x]++;

     //for(auto x:map1)cout<<x.first <<" " <<x.second <<"\n";

     for(auto x:map1){

		 m=max(m,x.second);

	 }

	 for(auto x:map1)

	 if(x.second==m){

		 B.push_back(x.first);}

		 else{continue;}

		 for(auto x:B)cout<<x <<"\n";

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

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

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

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

	QuickSort(s,0, n-1);

	

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

	{

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

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

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

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

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

using namespace std;

int main()

{

    map<string, int>mp;

    map<string, int>:: iterator it;

    int n, maxnum = 0;

    string s;

    cin>>n;

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

    {

        cin>>s;

        mp[s]++;

        if(mp[s] > maxnum)

            maxnum = mp[s];

    }

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

    {

        if(it->second == maxnum)

            cout<<it->first<<endl;

    }

    return 0;

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

#include <string>

#include <set>

#include <map>

using namespace std;



map<string, int> M;

set<string> ans;

string s[222222];



int main(void)

{

	cin.tie(NULL);

	cout.tie(NULL);

	ios::sync_with_stdio(false);



	int n, i;



	cin >> n;

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

	{

		cin >> s[i];

		M[s[i]]++;

	}



	int maxi = -1;

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

		if (maxi < M[s[i]])

			maxi = M[s[i]];



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

		if (maxi == M[s[i]])

			ans.insert(s[i]);



	set<string>::iterator it;

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

		cout << *it << endl;

	return 0;

}

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

#include <string>

#include <set>

#include <map>

using namespace std;



map<string, int> M;

set<string> ans;

string s;



int main(void)

{

	cin.tie(NULL);

	cout.tie(NULL);

	ios::sync_with_stdio(false);



	int n, i, maxi = 0;



	cin >> n;

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

	{

		cin >> s;

		M[s]++;

        maxi = max(maxi, M[s]);

	}



	for (auto p : M)

        if (p.second == maxi)

			cout << p.first << '\n';

	return 0;

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



#define ll long long

#define fornum(A,B,C) for(A=B;A<C;++A)

#define pii pair<int,int>

#define pll pair<ll,ll>



using namespace std;



/////////////////////////////////////////////////////



ll N;

string S[202020];

ll i, j, k;

ll ans = 1;

int main(){

    scanf("%lld", &N);

    fornum(i,0,N){

        cin >> S[i];

    }

    sort(S, S + N);

    string s = S[0];

    j = 0;

    fornum(i,1,N+1){

        if(s!=S[i]){

            ans = max(ans,i - j);

            j = i;

            s = S[i];

        }

    }

    s = S[0];

    j = 0;

    fornum(i,1,N+1){

        if(s!=S[i]){

            if(ans==i-j){

                

                cout << s << endl;

            }

            j = i;

            s = S[i];

        }

    }



    return 0;

}

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



#define ll long long

#define fornum(A,B,C) for(A=B;A<C;++A)

#define pii pair<int,int>

#define pll pair<ll,ll>



using namespace std;



/////////////////////////////////////////////////////



ll N;

char S[202020][14];

pll s[202020];

ll i, j, k;

ll ans = 1;

int main(){

    scanf("%lld", &N);

    fornum(i,0,N){

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

        k = 0;

        fornum(j,0,10){

            k *= 30;

            if(S[i][j])

                k += S[i][j] - 'a' + 1;

        }

        s[i] = {k, i};

    }

    sort(s, s + N);

    j = 0;

    fornum(i,1,N+1){

        if(s[j].first!=s[i].first){

            ans = max(ans, i - j);

            j = i;

        }

    }



    j = 0;

    fornum(i,1,N+1){

        if(s[j].first!=s[i].first){

            if(i-j==ans){

                printf("%s\n", S[s[j].second]);

            }

            j = i;

        }

    }



    return 0;

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

#include<algorithm>

#include<stdio.h>

#include<cstdio>



#include<string>

#include<map>

#include<vector>

using namespace std;

map<string,int> mp;

vector<string> v;

vector<string> ans;

int main(){

	int n;

	cin>>n;

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

		string s;

		cin>>s;

		if(!mp[s]){

			v.push_back(s);

		}

		mp[s]++;

	}

	int MAX=0;

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

		if(mp[v[i]]>MAX){

			MAX=mp[v[i]];

		}

	}

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

		if(mp[v[i]]==MAX){

			ans.push_back(v[i]);

		}

	}

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

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

		cout<<ans[i]<<endl;

	}

	return 0;

}

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

#include <string.h>

#include <algorithm>

#define N 200002

using namespace std;





char s[N][11];

int a[N], c, p[N];



int cmp(int x, int y)

{

	return strcmp(s[x], s[y]) < 0;

}



int main() 

{

	int n, i, max = 0, j, pi, t;

				

	scanf("%d", &n);

	for(i = 0; i < n; i++) scanf("%s", s[i]), p[i] = i;

	sort(p, p + n, cmp);

	

	for(i = 0; i < n; i = j){

		pi = p[i];

		for(j = i + 1; j < n && !strcmp(s[pi], s[p[j]]); j++);

		t = j - i;

		if(t > max){

			max = t;

			a[c = 0] = pi;

		}

		else if(t == max) a[++c] = pi;

	}

	for(i = 0; i <= c; i++){

		puts(s[a[i]]);

	}

			

	return 0;

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

#include<cstdlib>

#include<queue>

#include<set>

#include<vector>

#include<string>

#include<cmath>

#include<algorithm>

#include<stack>

#include<map>

#include<deque>

#include<cstdio>

#include<cstdio>

#include<time.h>

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ")

#define pdd(a,n,m)for(int i=0;i<m;i++)pd(a,m)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>



int n;

string s[222222];

map<string,int> ta;



int main(){

  cin>>n;

  rep(i,n)cin>>s[i];

  rep(i,n)ta[s[i]]++;

  int ma=-1;



  rep(i,n){

    ma=max(ma,ta[s[i]]);

  }

  sort(s,s+n);

  rep(i,n){

    if(ma==ta[s[i]]){

      cout<<s[i]<<endl;

      i+=(ta[s[i]]-1);

    }

  }



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 8.98147298842407x):
#include<algorithm>//sort,二分探索,など

#include<bitset>//固定長bit集合

#include<cmath>//pow,logなど

#include<complex>//複素数

#include<deque>//両端アクセスのキュー

#include<functional>//sortのgreater

#include<iomanip>//setprecision(浮動小数点の出力の誤差)

#include<iostream>//入出力

#include<map>//map(辞書)

#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)

#include<queue>//キュー

#include<set>//集合

#include<stack>//スタック

#include<string>//文字列

#include<utility>//pair

#include<list>

#include<vector>//可変長配列

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>

#define F first

#define S second

int dx[8] = { 1,0,-1,0,1,-1,-1,1 };

int dy[8] = { 0,1,0,-1,1,1,-1,-1 };





int n;

map<string, int>ta;



int main() {

    cin >> n;

    rep(i, n) {

        string s;

        cin >> s;

        ta[s]++;

    }



    int cnt = -1;

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

        cnt = max(cnt, (*it).second);

    }

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



        if(cnt==(*it).second)

        cout << (*it).first << endl;



    }



    return 0;

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

#include<cstdlib>

#include<queue>

#include<set>

#include<vector>

#include<string>

#include<cmath>

#include<algorithm>

#include<stack>

#include<map>

#include<deque>

#include<cstdio>

#include<cstdio>

#include<time.h>

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ")

#define pdd(a,n,m)for(int i=0;i<m;i++)pd(a,m)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>



int n;

string t[222222];

map<string,int>ta;



int main(){

  cin>>n;

  rep(i,n)cin>>t[i];

  rep(i,n)ta[t[i]]++;

  int ma=-1;

  rep(i,n)ma=max(ma,ta[t[i]]);

  for(map<string,int>::iterator it=ta.begin();it!=ta.end();it++){

    string key=(*it).first;

    int value=(*it).second;

    if(value==ma)cout<<key<<endl;

  }



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 8.97834363144557x):
#include<algorithm>//sort,二分探索,など

#include<bitset>//固定長bit集合

#include<cmath>//pow,logなど

#include<complex>//複素数

#include<deque>//両端アクセスのキュー

#include<functional>//sortのgreater

#include<iomanip>//setprecision(浮動小数点の出力の誤差)

#include<iostream>//入出力

#include<map>//map(辞書)

#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)

#include<queue>//キュー

#include<set>//集合

#include<stack>//スタック

#include<string>//文字列

#include<utility>//pair

#include<list>

#include<vector>//可変長配列

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>

#define F first

#define S second

int dx[8] = { 1,0,-1,0,1,-1,-1,1 };

int dy[8] = { 0,1,0,-1,1,1,-1,-1 };





int n;

map<string, int>ta;



int main() {

    cin >> n;

    rep(i, n) {

        string s;

        cin >> s;

        ta[s]++;

    }



    int cnt = -1;

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

        cnt = max(cnt, (*it).second);

    }

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



        if(cnt==(*it).second)

        cout << (*it).first << endl;



    }



    return 0;

}
// 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];

map<string,bool>p;

int main()

{

    int n,mx=-1;

    scanf("%d",&n);

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

        cin>>s[i];

        MP[s[i]]++;

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

    }

    sort(s+1,s+n+1);

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

        if(MP[s[i]]==mx&&p[s[i]]==false){

            cout<<s[i]<<endl;p[s[i]]=true;

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 8.163271066944036x):
#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;

}