#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  while (scanf("%d%d", &n, &m) != EOF) {
    int a[101], ans = 0, k, p = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      k = ceil(a[i] / (float)m);
      if (k >= p) {
        p = k;
        ans = i;
      }
    }
    if (ans == 0)
      printf("%d\n", n);
    else
      printf("%d\n", ans);
  }
}
