#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void test_case() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = INT_MAX, index;
  for (int i = 0; i < n; i++) {
    int k = (a[i] - i + n - 1) / n;
    if (ans > k) {
      ans = k;
      index = i + 1;
    }
  }
  cout << index;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  test_case();
}
