#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
  cin>>n;
  map<string, int> mp;
  int max_freq = 0;
  while(n--){
  	string s;
    cin>>s;
    mp[s]++;
    max_freq = max(max_freq, mp[s]);
  }
  for(auto i : mp){
  	if(i.second == max_freq){
    	cout<<i.first<<endl;
    }
  }
}