#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i, j, cur, k = LONG_LONG_MAX, ans;
  cin >> n;
  long long a[n], b[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    cur = a[i] % n;
    if (cur <= i)
      b[i] = a[i] + i - cur;
    else
      b[i] = a[i] + n - cur + i;
  }
  cout << endl;
  for (i = 0; i < n; i++) {
    if (b[i] < k) {
      ans = i;
      k = b[i];
    }
  }
  cout << ans + 1;
  return 0;
}
