#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  scanf("%d", &n);
  scanf("%d", &a);
  int minn = (a + n - 1) / n;
  int cnt = 1;
  for (int i = 2; i <= n; i++) {
    scanf("%d", &a);
    if (a + n < i) {
      if (minn > 0) {
        minn = 0;
        cnt = i;
      }
      continue;
    }
    if ((a + n - i) / n < minn) {
      minn = (a + n - i) / n;
      cnt = i;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
