#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int ans, comeback, temp;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (i == 0) {
      if (temp > m) {
        comeback = temp / m;
        if (temp % m != 0) comeback++;
      } else
        comeback = 0;
      ans = i + 1;
    } else {
      if (temp > m) {
        int x = temp / m;
        if (temp % m != 0) x++;
        if (x >= comeback) {
          comeback = x;
          ans = i + 1;
        }
      } else {
        if (comeback == 0) ans = i + 1;
      }
    }
  }
  cout << ans << "\n";
}
