#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].first = (a[i].first - i + n - 1) / n;
    a[i].second = i + 1;
  }
  sort(a.begin(), a.end());
  cout << a[0].second << "\n";
  return 0;
}
