#include <bits/stdc++.h>
using namespace std;
struct kdd {
  int xx, yy, d;
};
bool ss(const kdd &u, const kdd &v) { return u.d < v.d; }
int n, m;
int main() {
  scanf("%d", &n);
  int kq = 1000000000, u = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &m);
    m = m - i + 1;
    m = max(m, 0);
    int dem = m / n;
    if (m % n) dem += 1;
    if (dem < kq) kq = dem, u = i;
  }
  printf("%d", u);
  return 0;
}
