#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (true) {
    a %= b;
    if (a == 0) return b;
    b %= a;
    if (b == 0) return a;
  }
}
long long lcm(long long a, long long int b) {
  long long temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
bool isPrime(int n) {
  if (n == 1) return false;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
string al = "abcdefghijklmnopqrstuvwxyz";
pair<long long, long long> p[501000];
map<long long, long long> mapp;
map<pair<long long, long long>, long long> p1;
long long mi = 100000000000, n, m, x, y, k, ma = -999, in, sum, cnt, sum1;
long long c[2000000];
long long a[200000];
string s;
long long t, i, j, l, r;
int main() {
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < 1000000000; i++) {
    cnt = 0;
    for (j = 0; j < n; j++) {
      if (a[j] > 0) {
        a[j] -= m;
        cnt++;
        in = j;
      }
    }
    if (cnt == 0) {
      cout << in + 1;
      return 0;
    }
  }
}
