#include <bits/stdc++.h>
using namespace std;
int n, a, i, b;
int main() {
  cin >> n;
  int minn = 0x3f3f3f3f, l = 0, asd = 0;
  for (i = 1; i <= n; i++) {
    cin >> a;
    b = (a - i + 1) % n;
    a = (a - i + 1 + n) / n;
    if (b) a++;
    if (a == 1) {
      l = i++;
      break;
    }
    if (minn > a) {
      minn = a;
      l = i;
    }
  }
  for (; i <= n; i++) cin >> a;
  cout << l << "\n";
  return 0;
}
