use std::io::{stdin, Read};
use std::str::FromStr;
use std::cmp::Ordering;

fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}
 
fn main() {
    let n: usize = read().unwrap();
    let mut arr: Vec<i64> = Vec::new();
    for i in 0..n {
        let a: i64 = read().unwrap();
        arr.push(a);
    }
    let avg: f64 = (arr.iter().sum::<i64>() as f64) / (n as f64);
    println!("{}", avg);
    let mut avgdiff: Vec<(f64, usize)> = Vec::new();
    for _i in 0..n {
        let diff: f64 = ((arr[i] as f64) - avg).abs();
        avgdiff.push((diff, i));
    }
    avgdiff.sort_by(|a, b| {
        match a.0.partial_cmp(&b.0).unwrap() {
            Ordering::Equal => a.1.cmp(&b.1),
            other => other,
        }
    });
    //for i in 0..n {
    //  println!("{} {}", avgdiff[i].0, avgdiff[i].1);
    //}
    println!("{}", avgdiff[0].1);
}