#include <bits/stdc++.h>
using namespace std;
int N;
int A[100100];
int main() {
  ios::sync_with_stdio(0);
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  int minE = A[0];
  for (int i = 1; i < N; i++) minE = min(minE, A[i]);
  minE -= minE % N;
  for (int i = 0; i < N; i++) A[i] -= minE;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < N; j++)
      if (A[j] <= j + N * i) {
        cout << j + 1 << "\n";
        return 0;
      }
  return 0;
}
