#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  int i,j;
  int n,u;
  while(cin>>n>>u,n||u){
    int a[20],b[20]={};    
    for(i=0;i<n;++i){
      cin>>a[i];
      int m;
      cin>>m;
      for(j=0;j<m;++j){
	int p;
	cin>>p;
	b[i]|=1<<p;
      }
    }
    bool c[1<<20]={};
    c[0]=true;
    queue<pair<pair<int,int>,int> > d;
    d.push(make_pair(make_pair(0,0),0));
    while(!d.empty()){
      int p,q,r;
      p=d.front().first.first;
      q=d.front().first.second;
      r=d.front().second;
      if(q>=u)
	break;
      d.pop();
      for(i=0;i<n;++i){
	if((p&(1<<i))||(p&b[i])!=b[i]||c[p|(1<<i)])
	  continue;
	c[p|(1<<i)]=true;
	d.push(make_pair(make_pair(p|(1<<i),q+a[i]),r+1));
      }
    }
    cout<<d.front().second<<endl;
  }
  return 0;
}