#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i, _m = INT_MAX, p, x, val, mod;
  for (i = 0; i < n; i++) {
    cin >> x;
    mod = max(x - i, 0);
    if (mod % n == 0)
      val = mod / n;
    else {
      val = mod / n;
      val++;
    }
    val = max(val, 0);
    if (i + val * n < _m) {
      p = i;
      _m = i + val * n;
    }
  }
  cout << p + 1;
  return 0;
}
