#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
const long long mod = 1e9 + 7;
int n, m, k, t;
int a[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int pos = 1e9, ans = 0;
  for (int i = 1; i <= n; i++) {
    int now = (a[i] - i + n) / n;
    if (pos > now) {
      pos = now;
      ans = i;
    }
  }
  cout << ans << endl;
}
