#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int n,m,a[1010],t[1010];

int main(){
	while(cin>>n>>m&&n){
		rep(i,n)cin>>a[i];
		int M=INF,D=INF;
		rep(i,n){
			int x=(M+a[i]-(D<a[i]))/a[i]*a[i];
			if(x<=m)t[i]=x;
			else t[i]=m/a[i]*a[i];
			if(t[i]<M)M=t[i],D=a[i];
			else if(t[i]==M)D=min(D,a[i]);
		}
		int r,m=INF,d;
		rep(i,n){
			if(t[i]<m||t[i]==m&&a[i]<d)r=i+1,m=t[i],d=a[i];
			else if(t[i]==m&&a[i]==d)r=n;
		}
		cout<<r<<endl;
	}
}