import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

void main() {
  int n = readln.chomp.to!int;
  string[] s = new string[n];
  DList!string slist;
  int maxcount = 1;
  int count = 1;
  for(int i=0; i<n; i++) s[i] = readln.chomp;
  std.algorithm.sort(s);
  slist.insert(s[0]);
  for(int i=1; i<n; i++) {
    if(s[i-1]==s[i]) count++;
    else count=1;
    if(count>maxcount) {
      slist.clear;
      maxcount = count;
    }
    if(count==maxcount) slist.insert(s[i]);
  }
  while(!slist.empty) {
    writeln(slist.front);
    slist.removeFront;
  }
}

