#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  vector<int> v;
  vector<int> v1;
  for (int i = 0; i < a; i++) {
    int x;
    cin >> x;
    v.push_back(x);
    v1.push_back(i + 1);
  }
  for (int i = 0; v.size() > 1;) {
    v[0] -= b;
    if (v[0] > 0) {
      v.push_back(v[0]);
      v.erase(v.begin());
      v1.push_back(v1[0]);
      v1.erase(v1.begin());
    } else {
      v.erase(v.begin());
      v1.erase(v1.begin());
    }
  }
  cout << endl << v1[0];
}
