#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int A[n];
  for (long long int i = 0; i < n; i += 1) {
    cin >> A[i];
  }
  long long int min = std::numeric_limits<long long int>::max();
  for (long long int i = 0; i < n; i += 1) {
    if (A[i] < min) {
      min = A[i];
    }
  }
  long long int q = min / n;
  long long int x = (q * n);
  for (long long int i = 0; i < n; i += 1) {
    A[i] -= x;
  }
  long long int p = -1;
  long long int offest = 0;
  for (long long int i = 0; i < n; i += 1) {
    if ((A[i] - offest) <= 0) {
      p = i;
      break;
    }
    offest += 1;
  }
  if (p == -1) {
    for (long long int i = 0; i < n; i += 1) {
      if ((A[i] - offest) <= 0) {
        p = i;
        break;
      }
      offest += 1;
    }
  }
  cout << p + 1 << "\n";
  return 0;
}
