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 = new mutable.HashMap[String,Int]
    var max = 0

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

    strings.filter {
      case (k,v) => v == max
    }.keys.toArray.sorted.foreach { key =>
      System.out.println(
        key
      )
    }
  }
}
