#include <bits/stdc++.h>
using namespace std;
int main() {
  bool yes = 0;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long>(a)(n);
  for (long long i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  vector<long long> b(n);
  for (long long i = 0; i < n; ++i) {
    if (a[i] <= i) {
      cout << i + 1;
      cout << "\n";
      yes = 1;
      break;
    }
    long long k = (a[i] - i) / n + ((a[i] - i) % n != 0);
    b[i] = k * n + i;
  }
  if (!yes) {
    long long ind, m = LLONG_MAX / 2;
    for (long long i = 0; i < n; ++i) {
      if (m > b[i]) {
        ind = i;
        m = b[i];
      }
    }
    cout << ind + 1;
    cout << "\n";
  }
  return 0;
}
