#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs
#include <cstdio>	// require printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>	// require tolower, toupper
#include <fstream>	// require freopen
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef pair<pair<int, int>, int > P;

bool cmp (P a, P b )
{
	if (a.first.first != b.first.first )
		return a.first.first < b.first.first;

	if (a.first.second != b.first.second )
		return a.first.second < b.first.second;

	return a.second < b.second;
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.B", "r", stdin );
	int n, m;

	while (cin >> n >> m && n && m ){
		vector <int> a (n, 0 );
		int maxa = 0;
		for (int i = 0; i < n; i++){
			cin >> a[i];
//			maxa = max (maxa, a[i] );
		} // end for
//		while (maxa > m ){
//			m *= 10;
//		} // end while
		vector <P> rank (n );
		for (int i = 0; i < n; i++ ){
			rank[i].first.first = m/a[i]*a[i];
			rank[i].first.second = a[i];
			rank[i].second = i+1;
		} // end for
		sort (ALL(rank ), cmp );

		if (rank[0].first.first  == rank[1].first.first 
		 && rank[0].first.second == rank[1].first.second ){
			cout << n << endl;
		}else{
			cout << rank[0].second << endl;
		} // end if
	} // end loop
		
	return 0;
}