#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int ara[a];
  bool f = false;
  for (int l = 0; l < a; l++) {
    cin >> ara[l];
    if (ara[l] > b) f = true;
  }
  if (f == false)
    cout << a;
  else {
    int max = -1;
    for (int l = 0; l < a; l++) {
      if (ara[l] / b > max && ara[l] % b == 0) {
        max = ara[l] / b;
      } else if (ara[l] % b != 0) {
        if (ara[l] / b + 1 > max) max = ara[l] / b + 1;
      }
    }
    for (int l = a - 1; l >= 0; l--) {
      if (max == (ara[l] / b) && ara[l] % b == 0) {
        cout << l + 1;
        break;
      } else if (max == (ara[l] / b + 1) && ara[l] % b != 0) {
        cout << l + 1;
        break;
      }
    }
  }
}
