#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int arr[n];
  int a = -1;
  int l = -1;
  int k = 0;
  int brr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    brr[i] = ceil((arr[i] * 1.0) / m);
    if (brr[i] >= l) {
      a = (i + 1);
      l = brr[i];
    }
  }
  cout << a;
}
