object Main {
    def wrap(l: List[Int]): List[(Int, Int)] = {
        if (l.isEmpty) Nil
        else {
            val (x, y) = l.span(_ == l.head)
            (x.head, x.size) :: wrap(y)
        }
    }
    def main(args: Array[String]) = {
        val in = io.Source.stdin.getLines.map(_.toInt).toList
        val wrapped = wrap(in.sorted)
        wrapped.filter(_._2 == wrapped.maxBy(_._2)._2).foreach(p => println(p._1))
    }
}