#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int i, n, m, l, t;
  scanf("%d %d", &n, &m);
  int a[n];
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  do {
    t = 0;
    for (int i = 0; i < n; i++) {
      t += a[i];
      if (!a[i]) continue;
      a[i] = m >= a[i] ? 0 : a[i] - m;
      l = i + 1;
    }
  } while (t != 0);
  printf("%d\n", l);
  return 0;
}
