#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 1000000009, ans = 1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    if (x > (t - i + n) / n) {
      x = (t - i + n) / n;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
