#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a;
int n;
bool cmp(pair<int, int> x, pair<int, int> y) {
  int t1 = x.first;
  int t2 = y.first;
  int pos1 = t1 % n;
  int pos2 = t2 % n;
  int dis1 = (pos1 - x.second);
  if (dis1 < 0) dis1 += n;
  int dis2 = (pos2 - x.second);
  if (dis2 < 0) dis2 += n;
  return t1 + dis1 < t2 + dis2;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int u;
    cin >> u;
    a.push_back(make_pair(u, i));
    ;
  }
  int k = 0;
  for (int i = 1; i < n; i++) {
    int t1 = a[k].first;
    int pos1 = t1 % n;
    int dis1 = (a[k].second - pos1);
    if (dis1 < 0) {
      dis1 += n;
    }
    int p1 = t1 + dis1;
    int t2 = a[i].first;
    int pos2 = t2 % n;
    int dis2 = (a[i].second - pos2);
    if (dis2 < 0) {
      dis2 += n;
    }
    int p2 = t2 + dis2;
    if (p2 < p1) {
      k = i;
    }
  }
  cout << k + 1 << '\n';
}
