#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int res;
  int mx = INT_MIN;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (mx <= (a + m - 1) / m) {
      mx = (a + m - 1) / m;
      res = i + 1;
    }
  }
  cout << res << endl;
  return 0;
}
