#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  const int rem = (*min_element(a.begin(), a.end()) / n) * n;
  for (int &x : a) x -= rem;
  for (int t = 0;; ++t)
    if (a[t % n] - t <= 0) {
      cout << t % n + 1;
      break;
    }
  return 0;
}
