let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %f" (+.) 0.
let avg = Array.fold_left (+.) 0. a_s /. float n
let ans, m = ref 0, ref max_float
let _ = Array.iteri (fun i a -> let d = abs_float (a -. avg) in if d < !m then (ans := i; m := d)) a_s; Printf.printf "%d\n" !ans