fun main(args: Array<String>) {
    dwacon5th_prelims_a()
}

fun dwacon5th_prelims_a() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(' ').map { it.toDouble() }

    val average = aList.sum() / n

    var answer = 0
    var minDiff = 999.0
    aList.forEachIndexed { index, l ->
        val diff = Math.abs(average - l)
        if (diff < minDiff) {
            answer = index
            minDiff = diff
        }
    }

    println(answer)
}
