import java.io.{BufferedReader, InputStreamReader}

import scala.collection.mutable

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val n = in.readLine().toInt
    val strings = mutable.Map.empty[String, Int]

    for {
      _ <- 0 until n
    } {
      val s = in.readLine()
      val count = strings.getOrElse(s, 0)
      strings.update(s, count + 1)
    }

    val orderedStrings = strings.toSeq.sortWith {
      case ((_, count1), (_, count2)) => count1 > count2
    }

    val max = orderedStrings.head._2
    orderedStrings.collect {
      case (string, count) if count == max => string
    }.sorted.foreach(System.out.println)
  }
}
