#include <bits/stdc++.h>
using namespace std;
int main(void) {
  std::ios::sync_with_stdio(false);
  int n, m, a[1000], i, j;
  cin >> n >> m;
  for (i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] % m == 0)
      a[i] = a[i] / m;
    else
      a[i] = a[i] / m + 1;
  }
  j = n - 1;
  for (i = n - 1; i >= 0; --i) {
    if (a[i] > a[j]) j = i;
  }
  cout << j + 1 << "\n";
  return 0;
}
