#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, c = -1, index = -1;
  cin >> n >> m;
  int a[n];
  double b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = ceil((double)a[i] / m);
  }
  for (int i = 0; i < n; i++) {
    if (b[i] >= c) {
      c = b[i];
      index = i;
    }
  }
  cout << index + 1;
}
