#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int min1 = INT_MAX, ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < min1) {
      min1 = a[i];
    }
  }
  int pos = (min1) % n;
  int j = 0;
  for (int i = pos; i < pos + n; i++) {
    if (a[i % n] - min1 - j <= 0) {
      ans = i;
      break;
    }
    j++;
  }
  if (ans + 1 <= n)
    cout << ans + 1 << endl;
  else
    cout << (ans + 1) % n << endl;
  return 0;
}
