#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using st = string;
using ch = char;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ld PI = acos(-1);
const ll INF = 1e18;
st abc = "abcdefghijklmnopqrstuvwxyz";
st ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge {
  ll to, cost;
};
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  ll sum = 0;
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ll D = INF;
  ll ans;
  for (ll i = 0; i < n; i++) {
    if (D > abs(sum - n * a[i])) {
      D = abs(sum - n * a[i]);
      ans = i + 1;
    }
  }
  cout << ans << endl;
}
