#include <bits/stdc++.h>
using namespace std;
int a;
int main() {
  int n;
  scanf("%d", &n);
  int ans, j = 0, mn = INT_MAX;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a);
    int x = ceil((double)(a - j) / n);
    j++;
    if (x < mn) {
      ans = i;
      mn = x;
    }
  }
  printf("%d\n", ans);
}
