#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, m, a[maxn];
vector<int> b[2];
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    int mini = 0, ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (a[i] % m)
        a[i] = a[i] / m + 1;
      else
        a[i] = a[i] / m;
      if (mini <= a[i]) {
        mini = a[i];
        ans = i;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
