#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 7, mod = 1e9 + 7;
struct Comp {
  bool operator()(pair<long long int, long long int> p, long long int s) const {
    return p.first < s;
  }
  bool operator()(long long int s, pair<long long int, long long int> p) const {
    return s < p.first;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int arr[n], mn = mod;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    mn = min(arr[i], mn);
  }
  long long int k = mn;
  for (long long int i = 0; i < n; i++) arr[i] -= mn;
  long long int pos = ((1 + mn) % n) - 1;
  if (pos == -1) pos = n - 1;
  long long int t = 0;
  while (1) {
    if (pos == n) pos = 0;
    if ((arr[pos] - t) <= 0) {
      cout << pos + 1;
      return 0;
    }
    t++;
    pos++;
  }
}
