#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int a[n], i, last = n, max = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] % m == 0)
      a[i] = a[i] / m;
    else
      a[i] = a[i] / m + 1;
    if (a[i] > max) {
      max = a[i];
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] == max) last = i + 1;
  }
  cout << last << endl;
}
