#include <bits/stdc++.h>
using namespace std;
long long x[10000000];
int main() {
  long long n, minn = 10000000000, i, poz, j;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    if (x[i] < minn) minn = x[i];
  }
  for (int i = 0; i < n; i++) x[i] -= minn;
  i = minn % n;
  j = 0;
  while (true) {
    if (x[i] - j <= 0) {
      cout << i + 1;
      return 0;
    }
    i++;
    j++;
    if (i == n) i = 0;
  }
  return 0;
}
