#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f;
const double eps = (1e-10);
int n, arr[100000], mn = OO, pos;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    cin >> arr[i];
    mn = min(mn, arr[i]);
  }
  for (int i = 0; i < (int)(n); ++i) arr[i] -= mn;
  pos = mn % n;
  for (int i = 0; i < (int)(n); ++i) {
    int realpos = (pos + i) % n;
    if (arr[realpos] - i <= 0) {
      cout << realpos + 1 << '\n';
      return 0;
    }
  }
  return 0;
}
