#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, ans;
  cin >> n;
  int round = INT_MAX, pos = INT_MAX;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    int r = a / n, p = i;
    if (a % n > i) ++r;
    if (r < round) {
      round = r;
      pos = p;
      ans = i + 1;
    } else if (r == round && p < pos) {
      pos = p;
      ans = i + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
