#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, x, y, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first > m) {
      v.push_back(make_pair(v[i].first - m, v[i].second));
    }
  }
  cout << v[v.size() - 1].second + 1 << endl;
}
