#include <bits/stdc++.h>
bool comp(int a, int b) { return (a < b); }
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int T;
  T = 1;
  while (T--) {
    int n;
    cin >> n;
    int arry[n];
    int m;
    cin >> m;
    for (size_t i = 0; i < n; i++) {
      cin >> arry[i];
    }
    int pos = 0;
    int flag = 0;
    while (true) {
      flag = 1;
      for (size_t i = 0; i < n; i++) {
        if (arry[i] > 0) {
          arry[i] -= m;
          pos = i;
        }
        if (arry[i] > 0) {
          flag = 0;
        }
      }
      if (flag == 1) {
        break;
      }
    }
    cout << pos + 1 << "\n";
  }
  return 0;
}
