#include <bits/stdc++.h>
using namespace std;
;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, a, mx, idx;
  cin >> n >> m;
  mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if ((a - 1) / m + 1 >= mx) {
      mx = (a - 1) / m + 1;
      idx = i + 1;
    }
  }
  cout << idx << '\n';
  cout.flush();
}
