#include <bits/stdc++.h>
using namespace std;
long long int a[100005];
int main() {
  long long int n, i, x, y, c = INT_MAX;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= n; i++) {
    a[i] = a[i] - i + 1;
    x = (a[i] + n - 1) / n;
    if (x < c) {
      c = x;
      y = i;
    }
  }
  cout << y << endl;
  return 0;
}
