#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long arr[100001], ans[100001];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long displaced, mins;
  for (int i = 0; i < n; i++) {
    displaced = arr[i];
    if (displaced > i) {
      int cycle = displaced / n;
      int value = arr[i] - n * cycle;
      if (value <= i) {
        ans[i] = n * cycle + i;
      } else {
        ans[i] = (n * cycle) + i + n;
      }
    } else {
      ans[i] = i;
    }
  }
  mins = 1000000000009;
  int k;
  for (int i = 0; i < n; i++) {
    if (mins > ans[i]) {
      mins = ans[i];
      k = i;
    }
  }
  cout << k + 1 << endl;
  return 0;
}
