#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int inf = 1e9 + 7;
int a[maxn];
int n;
int main() {
  cin >> n;
  int ans = inf, idx;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] > i) {
      a[i] = i + ((a[i] - i - 1) / n + 1) * n;
    } else
      a[i] = i;
    if (a[i] < ans) {
      ans = a[i];
      idx = i + 1;
    }
  }
  cout << idx << endl;
  return 0;
}
