function main(input){
    inputI = input.split('\n');
    number = parseInt(inputI[0]);
    inputS = Array(number);
    max=0;
    count=1;
  ex=0;

    for(i=1;i<=number;i++){
        inputS[i-1]=inputI[i];
    }

    inputS=inputS.sort();

    for(i=1;i<=number;i++){
        if(inputS[i-1]==inputS[i]){
            count++;
        }
        else if(max<count){
            max=count;
            count=1;
        }
        else{
            count=1;
        }
    }
  	count=1;
    for(i=1;i<=number;i++){
        if(inputS[i-1]==inputS[i]){
            count++;
        }
        else if(max==count){
          console.log(inputS[i-1]);
          count=1;
          ex=1;
        }
        else{
            count=1;
        }
    }
  	if(ex==0){
      console.log(inputS[0]);
       }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));