#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int n, m, num, maxn = 0, res;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    num = a[i] / m + (a[i] % m ? 1 : 0);
    if (num >= maxn) res = i + 1;
    maxn = max(maxn, num);
  }
  printf("%d\n", res);
  return 0;
}
