#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int a[105];
  int n, m;
  cin >> n >> m;
  int maxi = 0, in = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = (a[i] + m - 1) / m;
    if (a[i] >= maxi) {
      in = i + 1;
      maxi = a[i];
    }
  }
  cout << in;
  return 0;
}
