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