while true do
  n, m = gets.split.map(&:to_i)
  break if n + m == 0
  a = gets.split.map(&:to_i)
  charge = []
  min = m
  for i in 0...n do
    case m / a[i] * a[i]
      when 0...min
        charge = [i]
        min = m / a[i] * a[i]
      when min
        charge.push(i)
    end
  end
  if charge.size == 1
    p charge.first + 1
  else
    charge.sort! {|i, j| a[i] <=> a[j]}
    p a[charge[0]] != a[charge[1]] ? charge.first + 1 : n
  end
end