#include<stdio.h>

int main()
{
  while(1)
    {
      int n,U,i,j,k,men,r,ans,res,pre;
      scanf("%d %d",&n,&U);
      if(n+U == 0)
	break;
      int G[n];
      int c[n];
      for(i = 0;i<n;i++)
	{
	  scanf("%d %d",&c[i],&k);
	    G[i] = 0;
	  for(j=0;j<k;j++)
	    {
	      scanf("%d",&r);
	      G[i] |= (1<<r);
	    }
	}
      
      ans = n;
      for(i = 1;i<(1<<n);i++)
	{
	  men = __builtin_popcount(i);
	  if(men >= ans)
	    continue;
	  //check
	  res = 0;
	  for(j=0;j<n;j++)
	    {
	      if((i >> j) & 1)
		{
		  pre = G[j];
		  pre &= i;
		  if(pre != G[j])
		    {
		      res = -1;
		      break;
		    }
		  res += c[j];
		  if(res >= U)
		    break;
		}
	    }
	  //check
	  if(res == -1)
	    continue;
	  if(res >= U)
	    if(ans > men)
	      ans = men;
	}
      
      printf("%d\n",ans);
    }
  return 0;
}