#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> v1, pair<long long, long long> v2) {
  if (v1.first > v2.first) {
    return false;
  } else if (v1.first == v2.first) {
    if (v1.second >= v2.second) {
      return false;
    } else {
      return true;
    }
  } else {
    return true;
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> v(n);
  long long check = 0;
  long long check2 = 0;
  vector<pair<long long, long long>> v1;
  vector<long long> ans;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] - i <= 0) {
      if (ans.size() == 0) {
        ans.push_back(i + 1);
      }
    } else {
      if (v[i] - ((v[i] - i) / n) * n <= i) {
        v1.push_back(make_pair((v[i] - i) / n, i + 1));
      } else {
        v1.push_back(make_pair((v[i] - i) / n + 1, i + 1));
      }
    }
  }
  if (ans.size() != 0) {
    cout << ans[0];
  } else {
    sort(v1.begin(), v1.end());
    cout << v1[0].second;
  }
  return 0;
}
