#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, cval, val, max, maxi;
  cin >> n >> m;
  max = -1;
  for (i = 1; i <= n; i++) {
    cin >> val;
    cval = (val + m - 1) / m;
    if (cval >= max) {
      max = cval;
      maxi = i;
    }
  }
  cout << maxi;
  return 0;
}
