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