https://codeforces.com/problemset/problem/450/A
#include<bits/stdc++.h>
using namespace std;
int s[105];
queue<int>q;
int main(void)
{
int n,m,x; cin>>n>>m;
for(int i=1;i<=n;i++) cin>>s[i],q.push(i);
while(q.size()>1)
{
int temp=q.front(); q.pop();
if(s[temp]<=m) continue;
else q.push(temp),s[temp]-=m;
}
cout<<q.front();
return 0;
}