#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0, x = 0, flag = 0;
  while (1) {
    flag = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] > 0) {
        a[i] -= k;
        flag = 1;
        x = i + 1;
        continue;
      }
    }
    if (!flag) break;
  }
  cout << x;
  return 0;
}
