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