#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, m, n;
  int a[1111];
  cin >> n >> m;
  int ans = -324242;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    k = a[i] / m;
    if (k * m < a[i]) k++;
    if (k >= ans) {
      ans = k;
      j = i;
    }
  }
  cout << j << endl;
}
