#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int dat[N];
  int sum = 0;
  for (int i = 0; i < N; ++i) cin >> dat[i], sum += dat[i];
  long long MIN = -1;
  int idx = -1;
  for (int i = 0; i < N; ++i) {
    if (idx == -1) {
      idx = i + 1;
      MIN = abs(sum - N * dat[i]);
    } else {
      if (MIN > abs(sum - N * dat[i])) {
        MIN = abs(sum - N * dat[i]);
        idx = i + 1;
      }
    }
  }
  cout << idx << endl;
  return 0;
}
