#include <bits/stdc++.h>
int main() {
  long int i, j, k, l, m, n, p, q, ar[200];
  scanf("%ld%ld", &n, &m);
  for (i = 0; i < n; i++) scanf("%ld", &ar[i]);
  k = n;
  i = 0;
  while (1) {
    if (ar[i] > 0) {
      ar[i] -= m;
      if (ar[i] <= 0) k--;
    }
    if (k == 0) {
      j = i;
      break;
    }
    if (i != n - 1)
      i++;
    else
      i = 0;
  }
  printf("%ld\n", j + 1);
  return (0);
}
