#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
ll fastpow(ll a, ll ex) {
  ll res = 1;
  while (ex) {
    if (ex & 1) res *= a;
    a *= a;
    ex >>= 1;
  }
  return res;
}
ll fastpow(ll a, ll ex, ll m) {
  a %= m;
  ll res = 1;
  while (ex) {
    if (ex & 1) res = (a * res) % m;
    a = (a * a) % m;
    ex >>= 1;
  }
  return res;
}
ll modinverse(ll a, ll m) {
  ll m0 = m, y = 0, x = 1;
  while (a > 1) {
    ll q = a / m;
    a %= m;
    swap(a, m);
    x -= q * y;
    swap(x, y);
  }
  if (x < 0) x += m0;
  return x;
}
vector<pii> moves_grid = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
inline bool move_okay(int x, int y, int n, int m) {
  return 0 <= x and x < n and 0 <= y and y < m;
}
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (auto& i : arr) cin >> i;
  auto mi = (*min_element(arr.begin(), arr.end()) / n) * n;
  for (int i = 0, cnt = 0;; ++i, ++cnt) {
    if (i == n) i = 0;
    if (arr[i] - mi - cnt <= 0) {
      cout << i + 1 << "\n";
      return;
    }
  }
}
signed main(void) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(20);
  int tt = 1;
  while (tt--) solve();
}
