#include <bits/stdc++.h>
using namespace std;
int n;
int a[100001];
int main() {
  int i, minn = 1000000001, t, f;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    int t = a[i] - i + n;
    int x = t / n;
    if (minn > x) {
      minn = x;
      f = i;
    }
  }
  cout << f << endl;
  return 0;
}
