#include <bits/stdc++.h>
using namespace std;
long long entrance[100020];
int circle[100020];
long long sum;
int main(void) {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  int MIN = 1000000080;
  int ans;
  int a;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    a = (a - i + n) / n;
    if (a < MIN) {
      ans = i;
      MIN = a;
    }
  }
  cout << ans;
  return 0;
}
