#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int a;
  int val, valmax = 0;
  int index;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a % m == 0)
      val = a / m;
    else
      val = a / m + 1;
    if (val >= valmax) {
      index = i;
      valmax = val;
    }
  }
  cout << index;
}
