#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  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;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] == *max_element(a, a + n)) {
      cout << i + 1 << endl;
      break;
    }
  }
  return 0;
}
