Problem: Problem B: B problem

2D enthusiasts (2D Respecters) from R University will participate in a programming training camp held at Atsu University. In this training camp, participants bring their own programming problems and use them for practice.

2DRespecters also ended up creating some issues. However, even three days before the training camp, the B problem had not been completed yet. The problem created by the person in charge of the first B problem was passed on after the C problem because the person in charge made it too difficult to constrain the problem. And no one wanted to deal with Problem B, which requires subtle adjustments to the difficulty level, which should not be too easy or too difficult. Since then, the chair of the person in charge of B problem has remained vacant.

Three days before the training camp, the Hope of 2D Respecters Expectations was finally launched to solve this problem. But he is not willing to create a B problem. He didn't want to create the B question himself, so he came up with a way to impose the person in charge of creating the B question on others. On the surface, his method determines who is responsible for creating the B problem equally.

His method is as follows.

* The person in charge of problem B is the person who takes the least amount of time to create the problem.
* If there are multiple people with the least work time, the person in charge of the problem with the smaller problem difficulty becomes the person in charge of creating the B problem.
* If there are multiple people with the least working time, and among them, there are multiple people with the lowest problem difficulty, he will be the person in charge of creating the B problem.

His method was well accepted by all members of 2D Respecters, as the seemingly least-working person was responsible for creating the B question.

However, his method has the following backs.

* Since each individual applies for the working hours verbally, it is possible to apply for a lie.
* If you apply for work hours that exceed the workable hours in question or negative work hours, you will be told that you are lying.
* It is known that the work time for creating a certain question is always an integral multiple of the difficulty level of the question, so even if you apply for work time contrary to this, it will be said to be a lie.

If the lie of the person who applied for the lie is revealed, that person will always be the person in charge of creating the B problem. Applications are made one by one in turn, and if a lie is revealed, it will be revealed at the time of application. When even one person finds a false application, the person in charge of creating the B problem will be decided, and no further applications will be made.

The applicant shall consider only the applications prior to him / her and apply for the minimum working time so that he / she will not be the person in charge of creating the B question at the time of application. At the time of application, if the applicant cannot report that he / she will not be the person in charge of creating the B problem, apply for the maximum working time that cannot be dismissed as a lie.

Create a program that asks who will be the B question creator when given a list of question difficulty levels for each individual in the order of application. Hope's application order is the last.

This question is fiction and has nothing to do with the process of creating this question.

Input

The input consists of multiple datasets, and the end of the dataset is represented by a line containing only two zeros separated by a single-byte space. The total number of datasets is 40 or less. In the first line of the dataset, the integer n (2 ≤ n ≤ ~~ 100 ~~ 1,000) and the integer m (1 ≤ m ≤ 1,000) are given separated by a single-byte space. In the second line of the dataset, the integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 1,000, 1 ≤ i ≤ n) are given separated by single-byte spaces.

The n and m on the first line represent the number of applicants and the working hours of the problem, respectively. The second line gives a list of question difficulty levels arranged in the order of application, where a_i represents the difficulty level of the question.

Output

For each data set, output the application order of the person in charge of creating the B question on one line.

Sample Input


3 100
3 7 4
5 24
4 6 12 3 8
5 1
1 1 2 2 3
0 0



Output for Sample Input


2
Four
Five






Example

Input

3 100
3 7 4
5 24
4 6 12 3 8
5 1
1 1 2 2 3
0 0


Output

2
4
5

Solution (in CPP):

Solution:
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;
const int INF=1000000000;

int n,m;
int a[1001];
int times[1001];
// »ÝÌBÌóâÒðT·
int searchBcand(int bound,int &aa){
    int minTime=INF;
    int cnt=0;
    int cnt2=0;
    int idx;
    for(int i = 0; i < bound; i++){
        if(minTime>times[i]){
            minTime=times[i];
            cnt=1;
            idx=i;
            cnt2=0;
        }
        else if(minTime==times[i]){
            // ±±ÅâèïÕxª¯¶¾Á½ç³çÉJEg
            if(a[i]<a[idx]){
                idx=i;
                cnt2=0;
            }
            else if(a[idx]==a[i]){
                cnt2++;
            }
        }
    }
    if(cnt2>=1){
        aa=idx;
        return -1;
    }
    return idx;
}

void solve(){

    while(cin>>n>>m&&!(n==0&&m==0)){

        for(int i = 0; i < n; i++)
            cin>>a[i];
        bool f=false;
        for(int i = 0; i < n; i++){
            // »Ý©½ÅAìÆÔªàÁÆà­È¢lÌlðT·B
            // àµ1lÈçÎA»ÌlæèâèÌïÕxª¯êÎA»ÌlÆ¯¶Ôðñ
            // »ÌlÆïÕxª¯¶ÈçA»ÌlÆ¯¶Ôðñ
            // ¬³¯êÎA»ÌlæèìÆÔðâ·B
            // âµÄàBâèSÉÈéÈçAÅåÜÅâµÄ¨­
            // ¡l¢éÌÅ êÎA»ÌlÆ¯¶ÔÉµÄ¨¯ÎA©ªÍIÎêÈ¢(B­)
            if(i==0){
                times[i]=(m/a[i])*a[i];
                continue;
            }
            // ßÌlðÝÄ²¸
            int aa=-1;
            int c=searchBcand(i,aa);
            if(c==-1)
                c=aa;
            // »ÌóâÒÉ¯È¢æ¤ÉÅ«é©`FbN
            // ÅåÌÔð
            int ntime=(times[c]/a[i]);
            if(times[c]%a[i]!=0)
                ntime++;
            // ÔðÝè
            ntime*=a[i];
            // Ýèµ½Ôª¯¶Èê
            if(ntime==times[c]){
                // ïÕxär
                if(a[c]<=a[i]){
                    times[i]=ntime;
                }
                else{
                    // à¤êiKÔðÕç·
                    ntime+=a[i];
                    // ±¦é©`FbN
                    if(ntime>m){
                        // z¦éÈçA¾ß
                        times[i]=ntime-a[i];
                    }
                    else{
                        times[i]=ntime;
                    }
                }
            }
            // Ýèµ½Ôª¯¶ÅÈ¢
            else{
                // ±¦é©`FbN
                if(ntime>m){
                    // z¦éÈçA¾ß
                    times[i]=ntime-a[i];
                }
                else{
                    times[i]=ntime;
                }
            }
        }
        // ±±Å
        if(!f){
            int tm;
            int c=searchBcand(n,tm);
            if(c==-1)
                cout<<n<<endl;
            else
                cout<<c+1<<endl;
        }
    }
}

int main(){

    solve();

    return 0;
}