#include <bits/stdc++.h>
using namespace std;
int n, x, mini, t, pos;
int main() {
  cin >> n;
  mini = 1000000000 + 1;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    t = x / n + 1 + (x % n > i - 1 ? 1 : 0);
    if (t < mini) {
      mini = t;
      pos = i;
    }
  }
  cout << pos;
  cin >> n;
  return 0;
}
