#include <bits/stdc++.h>
#define sz(arr) (int)(arr).size()
#define rng(arr) arr.begin(), arr.end()
#define show(x) cout << #x << " = " << x << endl;

using namespace std;
typedef long long int ll;

void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}

#define Cin(T, ...) \
  T __VA_ARGS__;    \
  _cin(__VA_ARGS__)

#define Cins(T, n, xs) \
  vector<T> xs(n);     \
  for (int i = 0; i < n; ++i) cin >> xs[i]

void Main();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}

void Main() {
  Cin(int, n);
  Cins(int, n, a);

  int sum = 0;
  for (int i = 0; i < n; ++i) sum += a[i];

  double mean = (double)sum / n;

  double mi = 1001001001;
  int mii = -1;
  for (int i = 0; i < n; ++i) {
    double sa = abs(a[i] - mean);
    if (mi > sa) {
      mi = sa;
      mii = i;
    }
  }

  cout << mii << endl;
}
#include<stdio.h>
int main(){
    long long input;
    scanf("%lld",&input);
    int i = 0;
    char ans[100];
    while(input > 0){
        int temp = input % 26;
        if(temp == 0){
            ans[i++] = 'z';
            input = (input/26) - 1;
        }
        else{
            ans[i++] = (temp - 1) + 'a';
            input = input/26;
        }
    }
    ans[i] = '\0';
    for(int j = i - 1; j >= 0; j--){
        printf("%c",ans[j]);
    }
    return 0;
}