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