#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, min = INT_MAX;
  cin >> n;
  vector<int> a(n);
  for (__typeof(0) c = 0; c < n; c++) {
    cin >> a[c];
    if (a[c] < min) min = a[c];
  }
  int k = min % n;
  for (__typeof(0) c = 0; c < n; c++) {
    a[c] -= min;
  }
  int s = -1;
  while (a[k] > 0) {
    a[k] -= ++s;
    if (a[k] <= 0) break;
    k++;
    if (k >= n) k = 0;
  }
  cout << k + 1;
}
