#include <bits/stdc++.h>
using namespace std;
struct Child {
  int candy;
  int id;
};
int n, c;
queue<Child> q;
Child child[2005];
int main() {
  scanf("%d %d", &n, &c);
  int candyNeed;
  for (int i = 0; i < n; i++) {
    scanf("%d", &candyNeed);
    child[i].candy = candyNeed;
    child[i].id = i + 1;
    q.push(child[i]);
  }
  while (!q.empty()) {
    Child cur = q.front();
    q.pop();
    cur.candy -= c;
    if (cur.candy > 0) {
      q.push(cur);
    } else {
      if (q.empty()) {
        cout << cur.id << endl;
      }
    }
  }
  return 0;
}
