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