#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100001];
  int n;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
    a[i] = a[i] - i;
    if (a[i] <= 0) {
      cout << i + 1;
      return 0;
    }
  }
  int pos = -1;
  long long mins = 1e18;
  for (int i = 0; i <= n - 1; i++) {
    double an = (double)a[i];
    int lol = ceil(an / n);
    if (mins > lol) {
      mins = lol;
      pos = i + 1;
    }
  }
  cout << pos;
  return 0;
}
