#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 55;
long long x[MAX];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  long long res = 0;
  long long MIN = 2e9;
  for (int i = 0; i < n; i++) {
    long long sol = (x[i] - i) / n;
    long long MAX = max(sol, (long long)0);
    if (((x[i] - i) % n) > 0) MAX++;
    if (MAX < MIN) {
      MIN = MAX;
      res = i + 1;
    }
  }
  cout << res;
  return 0;
}
