#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, m, n;
  while (scanf("%d", &n) != EOF) {
    int x[n];
    for (i = 0; i < n; i++) {
      scanf("%d", &x[i]);
    }
    int b = 0;
    for (i = 0; i < n; i++) {
      x[i] -= i;
      if (x[i] < 1) {
        printf("%d\n", i + 1);
        b = 1;
        break;
      }
      x[i] -= n;
    }
    j = 0;
    if (b == 0) {
      while (1) {
        if (x[j] <= 0) {
          printf("%d\n", j + 1);
          break;
        }
        x[j] -= n;
        j++;
        while (j == n) j = 0;
      }
    }
  }
  return 0;
}
