#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, vl, p;
  cin >> n >> m;
  vector<int> v, r;
  for (i = 0; i < n; i++) {
    cin >> vl;
    v.push_back(vl);
    p = vl / m;
    if (vl % m == 0)
      r.push_back(p);
    else
      r.push_back(p + 1);
  }
  vl = -1;
  for (i = n - 1; i >= 0; i--) {
    if (r[i] > vl) {
      p = i;
      vl = r[i];
    }
  }
  cout << p + 1;
  return 0;
}
