#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int m = INT_MAX;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m = min(m, a[i]);
  }
  for (int i = 0; i < n; i++) {
    a[i] -= m;
  }
  int c = 0;
  for (int i = m % n; i < n; i++) {
    if (a[i] <= c) {
      cout << i + 1 << endl;
      break;
    }
    c++;
    if (i == n - 1) {
      i = -1;
    }
  }
  return 0;
}
