#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
int lcm(int x, int y) { return x * y / gcd(x, y); }
long long fastpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b % 2) res *= a;
    b /= 2, a *= a;
  }
  return res;
}
int main() {
  int n, m, ind, Maxceil = 0, a;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if ((a - 1 + m) / m >= Maxceil) {
      Maxceil = (a - 1 + m) / m;
      ind = i;
    }
  }
  cout << ind << "\n";
}
