#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int arr[n];
  int times[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    times[i] = ceil((float)arr[i] / m);
  }
  int highest = -1;
  int winner = -1;
  for (int i = 0; i < n; ++i) {
    if (times[i] > highest || (times[i] == highest && i > winner)) {
      highest = times[i];
      winner = i;
    }
  }
  cout << winner + 1;
  return 0;
}
