#include <bits/stdc++.h>
using namespace std;
void filein() { freopen("input.txt", "r", stdin); }
void fileout() { freopen("output.txt", "w", stdout); }
int main() {
  int n, k;
  cin >> n >> k;
  int a[n + 2];
  for (int i = 0; i < n; i++) cin >> a[i];
  int s = n;
  while (s) {
    for (int i = 0; i < n; i++) {
      if (a[i] - k < 1 && a[i] > 0) {
        s--;
      }
      if (s < 1) {
        cout << i + 1;
        return 0;
      }
      a[i] -= k;
    }
  }
  cout << n;
}
