let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let s = Array.fold_left (+) 0 a_s
let ans, m = ref 0, ref max_int
let _ = Array.iteri (fun i a -> let d = abs @@ s - n * a in if d < !m then (ans := i; m := d)) a_s; Printf.printf "%d\n" !ans