#include <bits/stdc++.h>
using namespace std;
int v[200], i, n, m, y = 0, maxim = -1;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> v[i];
  bool ok = true;
  while (ok == true) {
    ok = false;
    for (i = 1; i <= n; i++)
      if (v[i] > 0) {
        v[i] -= m;
        y = i;
      }
    for (i = 1; i <= n; i++)
      if (v[i] > 0) ok = true;
  }
  cout << y;
  return 0;
}
