#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[100 + 10];
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  queue<int> q;
  for (int i = 0; i < n; i++) q.push(i);
  while (true) {
    int x = q.front();
    q.pop();
    a[x] -= m;
    if (a[x] > 0) q.push(x);
    if (q.size() == 0) {
      cout << x + 1 << endl;
      return 0;
    }
  }
}
