#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
int main() {
  int n;
  int a[101];
  double t = 0;
  pair<int, int> b[101] = {};
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    t += a[i];
    b[i].first = a[i];
    b[i].second = i;
  }
  sort(b, b + n);
  t = t / n;
  b[n].first = 1001;
  b[n].second = n;
  for (int i = 0; i < n; ++i) {
    if (abs(b[i].first - t) <= abs(b[i + 1].first - t)) {
      cout << b[i].second << endl;
      return 0;
    }
  }
  return 0;
}
