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