#include<cstdio>
#include<iostream>
#include<bitset>
#include<deque>
#include<algorithm>
using namespace std;

struct Pox
{
  int state,cost;
  Pox(int state,int cost):state(state),cost(cost){}
};

int main()
{
  while(1)
    {
      int n,U,k,r;
      scanf("%d %d",&n,&U);
      if(n+U == 0)
	break;
      deque<Pox> deq;
      int G[n];
      int c[n];
      for(int i = 0;i<n;i++)
	{
	  scanf("%d %d",&c[i],&k);
	    G[i] = 0;
	    if(!k)
	      deq.push_back(Pox((1<<i),c[i]));
	  for(int j=0;j<k;j++)
	    {
	      scanf("%d",&r);
	      G[i] |= (1<<r);
	    }
	}

      int ans = n;
      while(!deq.empty())
	{
	  Pox pox = deq.front(); deq.pop_front();
	  int num = __builtin_popcount(pox.state);
	  if(num >= ans)
	    continue;
	  for(int i=0;i<n;i++)
	    {
	      if((pox.state >> i) & 1)
		continue;
	      int pre = G[i];
	      pre &= pox.state;
	      if(pre != G[i])
		continue;
	      if(pox.cost + c[i] < U)
		deq.push_back(Pox(pox.state|(1<<i),pox.cost+c[i]));
	      else 
		ans = min(ans,num+1);
	    }
	}
      cout << ans << endl;
    }
  return 0;
}