#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll n;
ll arr[200005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  ll k = 1e9;
  for (int i = 1; i <= n; i++) {
    k = min(k, (ll)arr[i] / n);
  }
  if (k > 0)
    for (int i = 1; i <= n; i++) arr[i] -= (k * n);
  for (int i = n + 1; i <= 2 * n; i++) arr[i] = arr[i - n];
  for (int i = 1; i <= 2 * n; i++) {
    if (arr[i] - i + 1 <= 0) {
      if (i > n) i -= n;
      cout << i << '\n';
      break;
    }
  }
  return 0;
}
