#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long MOD = 998244353;
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<double> a(n);
  double sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double mid = sum / (double)n;
  long long res = 0;
  double dif = a[0];
  for (long long i = 0; i < n; i++) {
    if (dif > fabs(a[i] - mid)) {
      dif = fabs(a[i] - mid);
      res = i + 1;
    }
  }
  cout << (res) << '\n';
  ;
  return 0;
}
