#!/usr/bin/ruby
#
# 1032.rb: Course Planning for Lazy Students
#

### subroutines

def count_rec(k, num, csum, bits)
  return num if csum >= $u
  return $n if k >= $n

  min_num = count_rec(k + 1, num, csum, bits)

  ci, bi = $ncrs[k]
  if (bits & bi) == bi
    num0 = count_rec(k + 1, num + 1, csum + ci, bits | (1 << k))
    min_num = num0 if min_num > num0
  end

  min_num
end

### main

loop do
  $n, $u = gets.split.map(&:to_i)
  break if $n == 0 && $u == 0

  crs = []

  for i in (0...$n)
    ci, ki, *ris = gets.split.map(&:to_i)
    crs << [i, ci, ki, ris]
  end

  newseq = []
  newid = 0
  q = crs.clone

  while newid < $n
    cr = q.shift
    i, ci, ki, ris = cr

    if ris.select{|ri| newseq[ri].nil?}.length == 0
      newseq[i] = newid
      newid += 1
    else
      q << cr
    end
  end
  #p newseq

  $ncrs = []
  for cr in crs
    i, ci, ki, ris = cr

    nid = newseq[i]
    nrib = ris.inject(0){|b, ri| b | (1 << newseq[ri])}

    $ncrs[nid] = [ci, nrib]
  end
  #p $ncrs

  min_num = count_rec(0, 0, 0, 0)
  puts min_num
end