import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

void main() {
    int N, M;
    int[] A;
    
    bool input() {
        scanf("%d %d\n", &N, &M);
        if (N == 0 && M == 0) return false;
        A = readln.chomp.split(" ").map!(to!int).array;
        return true;
    }

    void solve() {
        int[] I = [0];
        int X = M / A[0] * A[0];
        for (int i = 1; i < N; i++) {
            int Y = M / A[i] * A[i];
            if (Y > X) continue;
            if (Y == X) {
                int p = A[ I[0] ], q = A[i];
                if (p == q) {
                    I ~= i;
                } else if (p > q) {
                    I = [i];
                }
            } else {
                X = Y;
                I = [i];
            }
        }
        if (I.length == 1) {
            writeln(I[0] + 1);
        } else {
            writeln(N);
        }
    }

    while (input) solve;
}