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

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

    strings.toSeq.filter {
      case (_ ,v) => v == max
    }.map(_._1).sorted.foreach {
      System.out.println
    }
  }
}
