#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <math.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
    for (T &x : vec)
        is >> x;
    return is;
}

//最大公約数
ll gcd(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    while (m != n)
    {
        if (m > n)
            m = m - n;
        else
            n = n - m;
    }
    return m;
}

//最小公倍数
ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

int main(){
    double n=0;
    double a[int(n)]={},total=0;

    cin >> n;
    REP(i,n){
        cin >> a[i];
        total+=a[i];
    }

    double ave=total/n;
    cout << "ave = " << ave << endl;
    double diff = 100000;
    double res=0;
    int ans=0;

    REP(i,n){
        res=fabs(a[i]-ave);
        if(res<diff){
            diff=res;
            ans = i;
        }
    }

    cout << ans << endl;

    return 0;
}