#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n;
  cin >> n;
  long int a[n];
  for (long int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long int temp = *min_element(a, a + n);
  long int pos = temp % n;
  long int min = temp;
  while (true) {
    if (a[pos] - min > 0) {
      min++;
      pos++;
      pos %= n;
    } else
      break;
  }
  cout << pos + 1 << endl;
  return 0;
}
