#include <bits/stdc++.h>
int main() {
  int n = 0;
  int m = 0;
  int max = 0;
  int index = 0;
  int j = 0;
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n + 1; i++) {
    int num = 0;
    scanf("%d", &num);
    if (num >= j * m) {
      index = i;
      j = (num / m);
      if (num % m != 0) {
        j++;
      }
    }
    if ((j - 1) * m < num && num <= j * m) {
      index = i;
    }
  }
  printf("%d\n", index);
  return 0;
}
