import scala.io.StdIn object Solution { def main(args: Array[String]) { val n = StdIn.readInt() val types = StdIn.readLine().split(" ").map(_.toInt) val stats = types.foldLeft(Vector(0, 0, 0, 0, 0))((s, t) => s.updated(t - 1, s(t - 1) + 1)) val max = stats.max println(stats.indexOf(max) + 1) } }