#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
const double EPS = 1e-9;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  int n;
  cin >> n;
  vector<pair<double, int>> num(n);
  double sum, ave;
  for (int(i) = 0; (i) < (int)(n); i++) {
    double a;
    cin >> a;
    sum += a;
    num.at(i) = make_pair(a, i + 1);
  }
  ave = sum / n;
  for (int(i) = 0; (i) < (int)(n); i++) {
    num.at(i).first -= ave;
  }
  sort((num).begin(), (num).end());
  cout << num.at(0).second << endl;
  return 0;
}
