#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <string>
#include <algorithm>
#include <cmath>
#include <ctype.h>
using namespace std;
#define dump(a) cout << (a) << '\n';
typedef long long Int;
Int mod = 1e9+7;
Int MOD = 998244353;

int main() {
    ios::sync_with_stdio(false);
    Int n;
    cin >> n;
    vector<double> a(n);
    double sum = 0;
    for (Int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    double mid = sum/(double)n;
    Int res = 0;
    double dif = a[0]
    for (Int i = 0; i < n; i++) {
        if (dif > fabs(a[i] - mid)) {
            dif = fabs(a[i] - mid);
            res = i+1;
        }
    }
    dump(res);
    return 0;  
}