#include <bits/stdc++.h>
using namespace std;
string uni = "abcdefghijklmnopqrstuvwxyz";
bool vis[100000] = {0};
bool check(long long int arr[], long long int k, long long int h) {
  long long int sum = 0;
  for (long long int i = 0; i <= k; i += 2) sum += arr[i];
  return sum <= h;
}
signed main() {
  long long int n;
  cin >> n;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int t = INT_MAX;
  for (long long int i = 0; i < n; i++) t = min(t, arr[i] / n);
  for (long long int i = 0; i < n; i++) {
    arr[i] -= t * n;
  }
  for (long long int i = 0; i < 2 * n; i++) {
    if (arr[i % n] - (i) <= 0) {
      cout << i % n + 1;
      return 0;
    }
  }
}
