#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b, mx = 0;
  cin >> n >> m;
  float t;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    t = ceil(t / m);
    if (t >= mx) {
      mx = t;
      b = i;
    }
  }
  cout << b << endl;
}
