#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, x;
  cin >> n >> x;
  int arr[n];
  std::deque<int> q;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    q.push_back(i);
  }
  while (q.size() != 1) {
    if (arr[q.front()] <= x) {
      q.pop_front();
    } else {
      arr[q.front()] -= x;
      q.push_back(q.front());
      q.pop_front();
    }
  }
  cout << q.front() + 1;
}
