#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  float n, m, start, k = 0, i, x;
  float f, s;
  cin >> n >> m >> start;
  for (i = 1; i < n; i++) {
    cin >> x;
    f = x / m;
    s = start / m;
    if (ceil(f) >= ceil(s)) {
      k = i;
      start = x;
    }
  }
  cout << k + 1 << endl;
  return 0;
}
