#include <bits/stdc++.h>
using namespace std;
bool vis[5010] = {0};
int res = 0;
long long a1, a2;
long long power(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  long long ar[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  long long res;
  long long min1 = INT_MAX;
  long long ans;
  ans = -1;
  for (int i = 0; i < n; i++) {
    res = i + ((ar[i] - i + n - 2) / n) * n + 1;
    if (res == ar[i]) res += n;
    if (res < min1) {
      ans = i + 1;
      min1 = res;
    }
  }
  cout << ans << endl;
  return 0;
}
