#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ra = 0;
  for (int j = 0; j < n; j++) {
    ra += a[j];
  }
  ra = ra / n;
  int min = 2 * n;
  int num;
  int sub;
  for (int k = n; k > 0; k--) {
    sub = abs(ra - a[k]);
    if (min > sub) {
      min = sub;
      num = k;
    }
  }
  printf("%d", num);
}
