#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int frames[N];
  for (int num = 0; num < N; num++) {
    cin >> frames[num];
    cout << frames[num] << "\n";
  }
  double ave = 0;
  for (int num = 0; num < N; num++) {
    ave += frames[num];
  }
  ave = ave / N;
  double ans = 1.7976931348623157e+308;
  int ans_no = 0;
  for (int num = --N; 0 <= num; num--) {
    if (abs(ave - frames[num]) <= ans) {
      ans = abs(ave - frames[num]);
      ans_no = num;
    }
  }
  cout << ans_no;
  return 0;
}
