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.8120132282323567x):
#include <bits/stdc++.h>

#include<iostream>

#include<functional>

using namespace std;

#define for_n for(long i=0 ; i<n ; i++)

int main()

{

    map<string,long> m;

    long n,max=0;

    cin>>n;

    string s;

    for_n

    {

        cin>>s;

        m[s]++;

        if(m[s]>max)

        {

            max=m[s];

        }

    }

    for(auto &el1:m)

    {

        if(el1.second==max)

        {

            cout<<el1.first<<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.7974611325763719x):
#include <bits/stdc++.h>

//#include "debug.h"

using namespace std;

#define pb push_back

#define mp make_pair

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

#define fi first

#define se second

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

typedef vector<int> VI;

typedef long long ll;

typedef pair<int,int> PII;

typedef double db;

mt19937 mrand(random_device{}()); 

const ll mod=1000000007;

int rnd(int x) { return mrand() % x;}

double startTime;

double getCurrentTime() {

return ((double)clock() - startTime) / CLOCKS_PER_SEC;

}

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

//freopen("output.out", "w", stdout);



int main(){

  ios_base::sync_with_stdio(false);

  cin.tie(0);

  int n ;

   cin>>n;

   map<string,int> s;

   while(n--){

   	 string k;

   	 cin>>k;

   	 s[k]++;

   }

   int mx=0;

   for(auto &p:s)if(mx<p.second)mx = p.second;

   for(auto &p:s)if(mx==p.second)puts(p.first.c_str());

   

}
// 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.8019720289408845x):
#include <bits/stdc++.h>

using namespace std;

 

int main() {

    int t;

    cin>>t; cin.ignore(); vector < pair<int, string> > v;

    vector <string> v1;

    map <string,int> mp;

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

        string a;

        cin>>a;

        mp[a]++;

    }

    int max=0;

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

        v.push_back(make_pair(it->second, it->first));

    }

    sort(v.rbegin(),v.rend());

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

        if (v[i].first>=max){

            v1.push_back(v[i].second);

            max=v[i].first;

        }

    }

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

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

        cout<<v1[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.8278071173278028x):
#include<iostream>

#include<iomanip>

#include<vector>

#include<algorithm>

#include<map>

#include<array>

#include<cstring>

#include<numeric>

#include<string>

#include<set>

#include<cstdio>

#include<cmath>

#include<unordered_map>

#include<bitset>

typedef long long ll;

typedef long double ld;

using namespace std;



int main()

{

    int n;

    cin>>n;

    vector<string> x;

    map<string, int> y;

    while(n--){

        string tmp;

        cin>>tmp;

        y[tmp]++;

    }

    int vote = 1;

    map<string, int>::iterator it = y.begin();

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

        if(i->second > vote){

             vote = i->second;

             it = i;

        }

    }

    vector<int> indAll;

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

        if(i->second == it->second) x.push_back(i->first);

    }

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

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

        cout<<x[i]<<"\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.8277946165704042x):
#include <bits/stdc++.h>

using namespace std;



map<string, int> freq;



bool custom(const pair<string, int> &a, const pair<string, int> &b) {

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

        return (a.first < b.first);

    } else {

        return (a.second > b.second);

    }

}



int main() {

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

    long long int N;

    cin >> N;



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

        string input;

        cin >> input;

        if (freq.find(input) == freq.end()) {

            freq.insert(make_pair(input, 1));

        } else {

            freq[input] = freq[input] + 1;

        }

    }



    vector<pair<string, int> > freq_vec(freq.size());

    copy(freq.begin(), freq.end(), freq_vec.begin());

    sort(freq_vec.begin(), freq_vec.end(), custom);

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



    long long int highest = freq_vec[0].second;



    for (int j = 0; j < freq_vec.size(); ++j) {

        if (freq_vec[j].second == highest) {

            cout << freq_vec[j].first << "\n";

        } else {

            break;

        }

    }

}
// 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.8272550116822044x):
#include<iostream>

#include<stdio.h>

#include<map>

#include<algorithm>

typedef long long ll;

using namespace std;



int main()

{

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

    //freopen("out.txt", "w", stdout);



    ll t,i;

    cin >> t;

    string s;



    map <string,ll> poll;

    map <string,ll>::iterator itr;



    while(t--)

    {

        cin >> s;



        if(!poll[s])

            poll[s]=1;



        else

            poll[s]++;

    }

    int ocMax = 0;



    for (itr = poll.begin(); itr != poll.end(); ++itr)

    {

        //cout << itr-> first << " " << itr->second <<endl;

        if ( itr -> second >= ocMax)

        {

            ocMax = itr -> second;

        }

    }



    for (itr = poll.begin(); itr != poll.end(); ++itr)

    {

        if ( itr -> second == ocMax)

        {

            cout << itr -> first << 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.8305769880308569x):
#include <iostream>

#include <vector>

#include <string>

#include <map>

#include <algorithm>



#define ll long long int

using namespace std;



void Solve(  ){

    map<string, int> poll;

    int n;

    cin >> n;

    string s;

    int highest = 0;

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

    {

        cin >> s;

        poll[s]++;

        if(poll[s] > highest)

        {

            highest = poll[s];

        }

    }

    //cout << highest << '\n';

    map<string, int> :: iterator itr;

    for(itr = poll.begin(); itr != poll.end(); ++itr)

    {

        if( itr -> second == highest) cout << itr -> first << '\n';

    }

}

int main(){

   // int t;

   // cin >> t;

   // while(t--)

   {

        Solve( );

      //  cout << '\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.8320776816058864x):
#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 cnt = 1;

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

    {

        cin >> a;



        auto it = m.find(a);

        if(it != m.end())

        {

            m[a]++;

            if(m[a] > cnt)

                cnt = m[a];

        }

        else

        {

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

        }

    }



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

    {

        if(it->second == cnt)

            cout << it->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.796110542124844x):
#include<bits/stdc++.h>

#pragma optimize("Ofast")

using namespace std;



using ll = long long;

const int N = 1e5+5;



int main()

{

    ios_base::sync_with_stdio(0);



    int n,mx = 0;

    cin >> n;

    map<string,int> mp;

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

        string s; cin >> s;

        mp[s]++;

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

    }

    vector<pair<int,string>> a;

    for(auto itr : mp) {

        a.push_back({itr.second, itr.first});

    }

    sort(a.rbegin(), a.rend());



    vector<string> ans;

    for(auto itr : a) {

        if(itr.first == mx) ans.push_back(itr.second);

        else break;

    }

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

    for(auto itr : ans)

        cout << itr << "\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.8215529181932748x):
#include<bits/stdc++.h>

using namespace std;

#define ll         long long int

#define co         cout

#define ci         cin

#define sf1(n)     scanf("%lld",&n)

#define sf2(n,m)   scanf("%lld %lld",&n,&m);

#define sf3(n,m,p) scanf("%lld %lld %lld",&n,&m,&p)

#define pf1(n)     printf("%lld\n",n);

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

#define en         cout<<endl;

#define pb         push_back

#define gcd(n,m)   __gcd(n,m)

#define lcm(n,m)   ((n)/__gcd(n,m))*(m)

#define fi         first

#define se         second

#define coy        cout<< "YES"<<endl;

#define con        cout<< "NO"<<endl;

#define f(a,b)     for(ll i=a;i<b;i++)

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

#define allr(x)    (x).rbegin(),(x).rend()

#define pi         pair<ll,ll>

#define br         break;

#define i64        long long

#define PI         2*acos(0.0)



int main()

{

    ll t,n,g,k,m,mx=1,mn=1e9,c,res,c1,x,y,w,z,c2;

    ci>>n;

    map<string,ll>mp;

    vector<string>a(n);

    f(0,n)

    {

        ci>>a[i];

        mp[a[i]]++;

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

    }

    set<string>b;

    map<string,ll>::iterator it;

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

    {

        if(it->se==mx) b.insert(it->fi);

    }

    set<string>:: iterator st;

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

        co<<*st<<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.812786748995974x):
#include <bits/stdc++.h>



#define pb              push_back

#define pi              acos(-1.0)

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

#define rloop(i,n,a)    for(int i=n;i>=a;i--)

#define ll              long long int

#define ff              first

#define ss              second

#define pii             pair<ll,ll>

#define sc1(a)          scanf("%d",&a)

#define sc2(a,b)        scanf("%d %d",&a,&b)

#define sc3(a,b,c)      scanf("%d %d %d",&a,&b,&c)

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

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

#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define fileout         freopen("output.txt","w",stdout)

#define filein          freopen("input.txt","r",stdin)

#define inf             2e9+5

#define Q               int q;cin>>q;while(q--)

#define check           cout<<"HI"<<endl;



//int x[]= {-1,0,0,1};

//int y[]= {0,-1,1,0};



using namespace std;



int main()

{

    int n,m=0;

    cin >> n;

    string s;

    map<string, int> mp;

    map<string, int> :: iterator it;

    loop(i,0,n)

    {

        cin >> s;

        mp[s]++;

        if(mp[s]>m)m=mp[s];

    }



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

    {

        if(it->ss==m)cout<<it->ff<<endl;

    }

}