#include <bits/stdc++.h>
using namespace std;
int dx[] = {+1, -1, +0, +0};
int dy[] = {+0, +0, +1, -1};
int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int hr[] = {-2, -2, -1, +1, +2, +2, -1, +1};
int hc[] = {+1, -1, +2, +2, -1, +1, -2, -2};
const int MAXN = 1e5 + 9;
int main() {
  int i, j, k, l, m, n, tc, t, mx, ans, total = 0;
  cin >> n >> m;
  mx = -9999;
  ans = -1;
  for (int i = 0; i < (int)n; i++) {
    cin >> k;
    t = k / m;
    if (k % m) t++;
    if (t >= mx) {
      mx = t;
      ans = i + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
