#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, ans, mx = 0;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    y = (x - 1) / m + 1;
    if (mx <= y) {
      mx = y;
      ans = i + 1;
    }
  }
  cout << ans << "\n";
}
