#include <bits/stdc++.h>
using namespace std;
int n, m, a[200], b[200];
int main() {
  scanf("%d%d", &n, &m);
  int maxx = -100, j = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = (a[i] + m - 1) / m;
    if (b[i] >= maxx) {
      maxx = b[i];
      j = i;
    }
  }
  printf("%d\n", j);
  return 0;
}
