#include <bits/stdc++.h>
using namespace std;
long long closest(long long n, long long x, long long i) {
  long long cur = i;
  while (cur < x) cur += n;
  return cur;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  std::vector<long long> v(n);
  std::vector<pair<long long, long long> > ans(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    ans[i] = {closest(n, v[i], i), i};
  }
  stable_sort(ans.begin(), ans.end());
  cout << ans[0].second + 1 << endl;
  return 0;
}
