#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t n, m;
  cin >> n;
  cin >> m;
  vector<int> A;
  A.resize(n);
  int maxx = -23;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> A[i];
    x = A[i] / m;
    if (A[i] % m != 0) x++;
    if (x >= maxx) maxx = x;
  }
  int64_t ans;
  for (int i = 0; i <= n - 1; i++) {
    int x = A[i] / m;
    if (A[i] % m != 0) x++;
    if (x == maxx) ans = i + 1;
  }
  cout << ans;
  return 0;
}
