import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val m = mutableMapOf<Int, Int>()
    while (sc.hasNext()) {
        val n = sc.nextInt()
        m[n] = m.getOrDefault(n, 0)+1
    }
    val l = m.toList()
    val max = l.maxBy { it.second }!!.second
    for ((a, _) in l.filter { it.second == max }.sortedBy { it.first }) println(a)
}
