#include <bits/stdc++.h>
int main() {
  int a[101] = {0};
  int n, m;
  std::cin >> n >> m;
  for (int i = 0; i < n; ++i) std::cin >> a[i];
  int ans = 0;
  bool b = true;
  while (b) {
    for (int i = 0; i < n; ++i) {
      if (a[i] <= 0) continue;
      a[i] -= m;
      ans = i + 1;
    }
    for (int i = 0; i < n; ++i) {
      if (a[i] > 0) {
        b = true;
        break;
      } else
        b = false;
    }
  }
  std::cout << ans;
}
