#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] % m == 0)
      a[i] = (a[i] / m);
    else
      a[i] = (a[i] / m) + 1;
  }
  int max = a[0], maxi = 0;
  for (int i = 0; i < n; ++i) {
    if (max <= a[i]) {
      max = a[i];
      maxi = i;
    }
  }
  cout << maxi + 1;
}
