#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, sfac = 1000000001, found = 0, ans;
  cin >> n;
  int a[n];
  for (int i = 0; i <= n - 1; i++) cin >> a[i];
  for (int i = 0; i <= n - 1; i++) {
    sfac = min(sfac, a[i] / n);
  }
  sfac--;
  if (sfac > 0) {
    for (int i = 0; i <= n - 1; i++) {
      a[i] -= (sfac * n);
    }
  }
  for (int i = 0; i <= n - 1; i++) {
    if (a[i] <= i) {
      found = 1;
      ans = i + 1;
      break;
    }
    a[i] -= n;
  }
  if (!found) {
    for (int i = 0; i <= n - 1; i++) {
      if (a[i] <= i) {
        found = 1;
        ans = i + 1;
        break;
      }
      a[i] -= n;
    }
  }
  if (!found) {
    for (int i = 0; i <= n - 1; i++) {
      if (a[i] <= i) {
        ans = i + 1;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
