let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  let sum = Array.fold_left ( + ) 0 as_ in
  Printf.printf "%d\n" @@ Array.fold_left (fun i j ->
    if abs (sum - as_.(i) * n) <= abs (sum - as_.(j) * n) then i else j) 0 @@
  Array.init n @@ fun i -> i

