#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238463;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 29;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
template <class T>
void chmax(T& a, const T& b) {
  a = max(a, b);
}
template <class T>
void chmin(T& a, const T& b) {
  a = min(a, b);
}
void cf996() {
  long double val;
  long long int n, mysol = 0, sol_stp = 10000000000000000, sol = 0;
  cin >> n;
  for (int i = 0; i < (n); i++) {
    cin >> val;
    if ((floor(val / n * 1.0)) * n + i >= val)
      mysol = floor(val / n * 1.0) * n + i;
    else
      mysol = ceil(val / n * 1.0) * n + i;
    if (val < n && i >= val)
      mysol = i;
    else if (val < n && i != val)
      mysol = n + i;
    if (mysol < sol_stp) {
      sol = i + 1;
      sol_stp = mysol;
    }
  }
  cout << sol << "\n";
}
int main() { cf996(); }
