#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000LL;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long mini = INT_MAX, res = -1;
  for (int i = 0; i < n; ++i) {
    long long x = (a[i] - i) / n;
    long long temp = n * x + i;
    if (temp < a[i]) temp += n;
    if (temp < mini) mini = temp, res = i + 1;
  }
  cout << res << "\n";
  return 0;
}
