#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int M = 1e5 + 50;
int a[M];
int main() {
  int n, ans, Min = inf;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] = a[i] - i + 1;
    int cnt = (a[i] + n - 1) / n;
    if (cnt + 1 < Min) {
      Min = cnt + 1;
      ans = i;
    }
  }
  cout << ans;
}
