#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
const long long INF = 0;
const long long MAXN = 1e5 + 10;
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> arr(n);
  long long hsh[101];
  memset(hsh, -1, sizeof hsh);
  float num = 0;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (hsh[arr[i]] == -1) hsh[arr[i]] = i;
    num += arr[i];
  }
  num /= n;
  set<long long> s((arr).begin(), (arr).end());
  auto it = upper_bound((s).begin(), (s).end(), num);
  if (it == s.end()) {
    cout << hsh[*(--it)] << "\n";
  } else if (it == s.begin())
    cout << hsh[*(it)] << "\n";
  else {
    float diff = abs(num - 1.0 * (*it));
    float diff1 = abs(num - 1.0 * (*(--it)));
    if (diff >= diff1)
      cout << hsh[*it];
    else
      cout << hsh[*(++it)] << "\n";
  }
  return 0;
}
