#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
const int M = 1e9 + 7;
int n, k;
int a[N], b[N];
int mx;
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    int q = ceil((double)a[i] / k);
    b[i] = q;
    mx = max(mx, b[i]);
  }
  for (int i = n; i >= 1; i--) {
    if (b[i] == mx) {
      cout << i << "\n";
      return 0;
    }
  }
  return 0;
}
