object Main extends App {
  val src: List[Int] = io.Source.stdin.getLines.map(_.toInt).toList

  val countedList: List[Int] = (for (i <- 1 to src.max) yield (src.count(_ == i))).toList

  println(countedList.zipWithIndex.collect { case (a, b) if a == countedList.max => b + 1 }.mkString("\n"))
}