#include <bits/stdc++.h>
using namespace std;
long long pr[1000007], fact[1000007];
void prime() {
  pr[0] = 1;
  pr[1] = 1;
  for (long long i = 2; i < sqrt(1000007); i++) {
    for (long long j = 2 * i; j <= 1000007; j += i) {
      pr[j] = 1;
    }
  }
}
void facto() {
  long long i = 1;
  fact[0] = 1;
  while (i <= 100000) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
    i++;
  }
}
long long fastpow(long long n, long long r) {
  if (r == 0) return 1;
  if (r == 1) return n;
  long long hr = fastpow(n, r / 2);
  if (r % 2 == 0)
    return (hr * hr) % 1000000007;
  else
    return (((hr * hr) % 1000000007) * n) % 1000000007;
}
int countDivisors(long long n) {
  long long cnt = 0;
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
int inv(int n) { return fastpow(n, 1000000007 - 2); }
long long mini = 999999999;
int main() {
  long long a[100005];
  vector<long long> v;
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) {
    a[i] -= i;
    if (a[i] <= 0) a[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] % n == 0)
      v.push_back(a[i] / n);
    else
      v.push_back((a[i] / n) + 1);
  }
  for (long long i = 0; i < n; i++)
    if (v[i] < 0) v[i] = 0;
  for (long long i = 0; i < n; i++) {
    mini = min(v[i], mini);
  }
  for (long long i = 0; i < n; i++) {
    if (v[i] == mini) {
      cout << i + 1;
      break;
    }
  }
  return 0;
}
