#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v(n, 0);
  int minq = 10e9 + 1;
  int ans = -1;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] - i <= 0) {
      cout << i + 1 << endl;
      return 0;
    }
    minq = min(minq, v[i]);
  }
  for (int i = 0; i < n; i++) v[i] -= (minq / n) * n;
  int m = 0;
  bool found = false;
  while (!found) {
    for (int i = 0; i < n && !found; i++) {
      if (v[i] - m <= 0) {
        ans = i;
        found = true;
      }
      m++;
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
