#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, last;
  cin >> n >> m;
  double t, mx;
  mx = 0;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    if (ceil(t / m) >= mx) {
      last = i;
      mx = ceil(t / m);
    }
  }
  cout << last << endl;
}
