#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
int main() {
  int N;
  cin >> N;
  int v[100];
  int s[101];
  int c = 0;
  double t = 0;
  for (int i = 0; i < (int)(101); ++i) {
    s[i] = 0;
  }
  for (int i = 0; i < (int)(N); ++i) {
    int res;
    cin >> res;
    t += res;
    if (s[res] == 0) {
      v[c] = res;
      s[res] = i + 1;
      c++;
    }
  }
  t /= (double)N;
  sort(v, v + c);
  int res;
  for (int i = 0; i < (int)(N); ++i) {
    if (t <= v[i]) {
      res = i;
      break;
    }
  }
  if (res >= 1) {
    if (abs(v[res - 1] - t) <= abs(v[res] - t)) {
      cout << s[v[res - 1]] - 1 << endl;
    } else {
      cout << s[v[res]] - 1 << endl;
    }
  } else {
    cout << s[v[res]] - 1 << endl;
  }
}
