#include <bits/stdc++.h>
using namespace std;
long long dx[] = {-1, 1, 0, 0};
long long dy[] = {0, 0, -1, 1};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (auto &k : v) {
    cin >> k;
  }
  long long moves = INT_MAX;
  long long lane = -1;
  for (long long i = 0; i < n; ++i) {
    long long m = (v[i] - i);
    if (m <= 0) {
      if (moves > 0) {
        moves = 0;
        lane = i + 1;
      }
    } else {
      long long k = (m + n - 1) / n;
      if (moves > k) {
        moves = k;
        lane = i + 1;
      }
    }
  }
  cout << lane;
}
