#include <bits/stdc++.h>
int as[(100)];
int main() {
  int i, n, m, lst, cnt;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; ++i) scanf("%d", as + i);
  for (cnt = n; cnt;) {
    for (i = 0; i < n; ++i) {
      if (as[i] > 0) {
        as[i] -= m;
        if (as[i] <= 0) {
          lst = i + 1;
          cnt -= 1;
        }
      }
    }
  }
  printf("%d\n", lst);
  return EXIT_SUCCESS;
}
