#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32000000")
#pragma GCC optimize("O3")
using namespace std;
int n;
int arr[200006];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  cout.precision(9);
  srand(time(0));
  cin >> n;
  long long ans = 1000000000000000007LL, t = 1000000000000000007LL;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] <= i) {
      if (i < t) {
        t = i;
        ans = i + 1;
      }
    } else {
      arr[i] -= i;
      long long tt = arr[i] / n * n;
      if (tt < arr[i]) {
        tt += n;
      }
      if (tt < t) {
        t = tt;
        ans = i + 1;
      }
    }
  }
  cout << ans;
  return 0;
}
