#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
vector<LL>state,monit;
const LL N=20;
LL dp[1<<N];
struct node
{
    LL requr,monitors,num,cnt,pos;
}a[25];
bool cmp(node a,node b)
{
    if(a.pos==b.pos) return a.cnt<b.cnt;
    else return a.pos<b.pos;
}
int main()
{
    LL n,m,b;;
    //n is the number of his friends,m is the number of problems,b is the cost of each monitor;
    while(~scanf("%I64d%I64d%I64d",&n,&m,&b))
    {
        state.clear();
        monit.clear();
        LL tmp,number;
        for(LL i=0; i<(1<<m); i++)
            dp[i]=0xffffffffffffff;
        dp[0]=0;
        for(LL i=0; i<n; i++)
        {
            tmp=0;
            scanf("%I64d%I64d%I64d",&a[i].requr,&a[i].monitors,&a[i].num);
            for(LL j=0; j<a[i].num; j++)
            {
                scanf("%I64d",&number);
                tmp+=(1<<(number)-1);
            }
            a[i].pos=tmp;
            a[i].cnt=a[i].requr+a[i].monitors*b;
        }
        sort(a,a+n,cmp);
        for(LL i=0; i<n; i++)
        {
            if(dp[a[i].pos]>a[i].cnt)
            {
                dp[a[i].pos]=min(a[i].cnt,dp[a[i].pos]);
                state.push_back(a[i].pos);
                monit.push_back(a[i].monitors);
            }
        }
        for(LL i=0; i<state.size(); i++)
        {
            for(LL j=0; j<state.size(); j++)
            {
                if((state[i]|state[j])>(1<<m))
                {
                    continue;
                }
                dp[state[i]|state[j]]=min(dp[state[i]|state[j]],dp[state[i]]+dp[state[j]]-min(monit[i],monit[j])*b);
            }
        }
        LL ans=(1<<m)-1;
        if(dp[ans]==0xffffffffffffff) printf("-1\n");
        else printf("%I64d\n",dp[ans]);
    }
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL __int64
#define INF 0x9ffffffffffffff
using namespace std;
LL dp[1<<21];
struct fri
{
    int x,k,cnt;
} a[102];
bool cmp(fri a,fri y)
{
    return a.k<y.k;
}
LL min(LL a,LL b)
{
    return a>b?a:b;
}
int main()
{
    int n,m,b;
    LL i,j;
    while(~scanf("%d%d%d",&n,&m,&b))
    {
        for(i=0; i<n; i++)
        {
            int num,pos;
            scanf("%d%d%d",&a[i].x,&a[i].k,&num);
            a[i].cnt=0;
            for(j=0; j<num; j++)
            {
                scanf("%d",&pos);
                --pos;
                a[i].cnt|=(1<<pos);
            }
        }
        sort(a,a+n,cmp);
        for(i=0; i<(1<<m); i++)
        {
            dp[i]=INF;
        }
        LL ans=INF;
        printf("%I64d\n",ans);
        for(i=0; i<n; i++)
        {
            for(j=0; j<(1<<m); j++)
            {
                if(dp[j]>INF) continue;
                dp[(j|a[i].cnt)]=min(dp[(j|a[i].cnt)],dp[j]+a[i].x);
            }
            ans=min(ans,dp[(1<<m)-1]+a[i].k*b);
        }
        printf("%I64d\n",ans==INF?-1:ans);
    }
    return 0;
}


#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<set>
using namespace std;
const long long inf = ((long long)1 << 62);
long long n, m, b, c;
struct poc
{
    long long x, k, z;
};
vector<poc> a;
long long d[1 << 21];
bool cmp(poc x, poc y)
{
    if (x.k < y.k) return true;
    else return false;
}
int main()
{
    cin >> n >> m >> b;
    for (int i = 1; i <= n; i++)
    {
        poc lol;
        int kol;
        cin >> lol.x >> lol.k >> kol;
        lol.z = 0;
        for (int j = 1; j <= kol; j++)
        {
            cin >> c;
            c--;
            lol.z |= 1 << c;
        }
        a.push_back(lol);
    }
    sort(a.begin(), a.end(), cmp);
    for (int i = 0; i <= 1 << m; i++) d[i] = inf;
    long long ans = inf;
    d[0] = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 1 << m; j++) if (d[j] < inf)
            {
                int jj = j | a[i].z;
                d[jj] = min(d[jj], d[j] + a[i].x);
            }
        ans = min(ans, d[(1 << m) - 1] + b * a[i].k);
    }
    if (ans == inf) cout << -1;
    else cout << ans;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
LL dp[1<<21];
const int INF=((LL)(1<<62));
struct fri
{
    LL x,k,cnt;
} a[102];
bool cmp(fri z,fri y)
{
    if(z.k<y.k) return true;
    else return false;
}
int main()
{
    int n,m,b;
    int i,j;
    while(~scanf("%d%d%d",&n,&m,&b))
    {
        for(i=0; i<n; i++)
        {
            int num,pos;
            scanf("%d%d%d",&a[i].x,&a[i].k,&num);
            a[i].cnt=0;
            for(j=0; j<num; j++)
            {
                scanf("%d",&pos);
                --pos;
                a[i].cnt|=(1<<pos);
            }
        }
        sort(a,a+n,cmp);
        for(i=0; i<=(1<<m); i++)
        {
            dp[i]=INF;
        }
        dp[0]=0;
        LL ans=INF;
        int top=1<<m;
        int flag=0;
        for(i=0; i<n; i++)
        {
            for(j=0; j<top; j++)
            {
                if(dp[j]<INF)
                {
                    printf("%d  %d\n",a[i].cnt,j);
                    int tmp=(j|a[i].cnt);
                   dp[tmp]=min(dp[j],dp[j]+a[i].x);
                }
            }
            ans=min(ans,dp[top]+a[i].k*b);
        }
        if(ans==INF) printf("-1\n");
        else printf("%I64d\n",ans);
    }
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
long long  dp[1<<21];
const long long  INF=((long long)1<<62);
struct friends
{
    long long x,k,cnt;
}a[102];
bool cmp(friends z,friends y)
{
    if(z.k<y.k) return true;
    else return false;
}
int main()
{
    long long n,m,b;
    int i,j;
    while(cin>>n>>m>>b)
    {
        for(i=0; i<n; i++)
        {
            int num,pos;
            cin>>a[i].x>>a[i].k>>num;
            a[i].cnt=0;
            for(j=0; j<num; j++)
            {
                cin>>pos;
                --pos;
                a[i].cnt=(a[i].cnt|(1<<pos));
            }
        }
        sort(a,a+n,cmp);
        for(i=0; i<=(1<<m); i++)
        {
            dp[i]=INF;
        }
        dp[0]=0;
        long long ans=INF;
        int top=(1<<m);
        for(i=0; i<n; i++)
        {
            for(j=0; j<top; j++)
            {
                if(dp[j]<INF)
                {
                   int tmp=(j|a[i].cnt);
                   dp[tmp]=min(dp[tmp],dp[j]+a[i].x);
                }
            }
            ans=min(ans,dp[top-1]+a[i].k*b);
        }
        if(ans==INF) printf("-1\n");
        else printf("%I64d\n",ans);
    }
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
vector<int>state;
const int N=20;
LL dp[1<<N];
int main()
{
    LL n,m,b,requr[20],monitors[20],num[20];
    //n is the number of his friends,m is the number of problems,b is the cost of each monitor;
    while(~scanf("%I64d%I64d%I64d",&n,&m,&b))
    {
        state.clear();
        LL tmp,number;
        for(int i=0;i<(1<<m);i++)
            dp[i]=0xfffffffffff;
        dp[0]=0;
        //cout<<dp[(1<<m)-1]<<endl;

        for(int i=0;i<n;i++)
        {
            tmp=0;
            scanf("%I64d%I64d%I64d",&requr[i],&monitors[i],&num[i]);
            for(int j=0;j<num[i];j++)
            {
                scanf("%I64d",&number);
                tmp+=(1<<(number)-1);
            }
            dp[tmp]=min(requr[i]+monitors[i]*b,dp[tmp]);
           // printf("%d\n",dp[tmp]);
            state.push_back(tmp);
        }
        for(int i=0;i<state.size();i++)
        {
            for(int j=0;j<state.size();j++)
            {
                if(state[i]|state[j]>(1<<m)) continue;
                dp[state[i]|state[j]]=min(dp[state[i]|state[j]],dp[state[i]]+dp[state[j]]-min(monitors[i],monitors[j])*b);
            }
        }
        LL ans=(1<<m)-1;
        if(dp[ans]==0xfffffffffff) printf("-1\n");
        else printf("%I64d\n",dp[ans]);
    }
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
vector<int>state;
const int N=20;
LL dp[1<<N];
int main()
{
    LL n,m,b,requr[20],monitors[20],num[20];
    //n is the number of his friends,m is the number of problems,b is the cost of each monitor;
    while(~scanf("%I64d%I64d%I64d",&n,&m,&b))
    {
        state.clear();
        LL tmp,number;
        for(int i=0;i<(1<<n);i++)
            dp[i]=0xffffffffffffff;
        dp[0]=0;
        dp[(1<<m)-1]=0xffffffffffffff;
        for(int i=0;i<n;i++)
        {
            tmp=0;
            scanf("%I64d%I64d%I64d",&requr[i],&monitors[i],&num[i]);
            for(int j=0;j<num[i];j++)
            {
                scanf("%I64d",&number);
                tmp+=(1<<(number)-1);
            }
            dp[tmp]=min(requr[i]+monitors[i]*b,dp[tmp]);
            state.push_back(tmp);
        }
        for(int i=0;i<state.size();i++)
        {
            for(int j=0;j<state.size();j++)
            {
                dp[state[i]|state[j]]=min(dp[state[i]|state[j]],dp[state[i]]+dp[state[j]]-min(monitors[i],monitors[j])*b);
            }
        }
        int ans=(1<<m)-1;
        if(dp[ans]==0xffffffffffffff) printf("-1\n");
        else printf("%I64d\n",dp[ans]);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const long long INF=((long long )1<<62);
struct friends
{
    long long  x,k,cnt;
};
vector<friends>q;
long long  dp[1<<21];
bool cmp(friends a,friends b)
{
    if(a.k<b.k) return true;
    else return false;
}
int main()
{
    long long  n,m,b,i,j;
    cin>>n>>m>>b;
    for(i=0; i<n; i++)
    {
        friends s;
        int num,pos;
        cin>>s.x>>s.k>>num;
        s.cnt=0;
        for(j=0; j<num; j++)
        {
            cin>>pos;
            pos--;
            s.cnt|=(1<<pos);
        }
        q.push_back(s);
    }
    sort(q.begin(),q.end(),cmp);
    for(i=1; i<=(1<<m); i++)
        dp[i]=INF;
    dp[0]=0;
   long long  ans=INF;
    for(i=0; i<n; i++)
    {
        for(j=0; j<(1<<m); j++)
        {
            if(dp[j]<INF)
            {
                int tmp=j|q[i].cnt;
                dp[tmp]=min(dp[tmp],dp[j]+q[i].x);
            }
        }
        ans=min(ans,dp[j-1]+q[i].k*b);
    }
    if(ans==INF) cout<<-1<<endl;
    else cout<<ans<<endl;
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
vector<LL>state,monit;
const LL N=20;
LL dp[1<<N];
struct node
{
    LL requr,monitors,num,cnt,pos;
}a[25];
bool cmp(node a,node b)
{
    if(a.pos==b.pos) return a.cnt<b.cnt;
    else return a.pos<b.pos;
}
int main()
{
    LL n,m,b;;
    //n is the number of his friends,m is the number of problems,b is the cost of each monitor;
    while(~scanf("%I64d%I64d%I64d",&n,&m,&b))
    {
        state.clear();
        monit.clear();
        LL tmp,number;
        for(LL i=0; i<(1<<m); i++)
            dp[i]=0xffffffffffffff;
        dp[0]=0;
        for(LL i=0; i<n; i++)
        {
            tmp=0;
            scanf("%I64d%I64d%I64d",&a[i].requr,&a[i].monitors,&a[i].num);
            for(LL j=0; j<a[i].num; j++)
            {
                scanf("%I64d",&number);
                tmp+=(1<<(number)-1);
            }
            a[i].pos=tmp;
            a[i].cnt=a[i].requr+a[i].monitors*b;
        }
        sort(a,a+n,cmp);
        for(LL i=0; i<n; i++)
        {
            if(dp[a[i].pos]>a[i].cnt)
            {
                dp[a[i].pos]=min(a[i].cnt,dp[a[i].pos]);
                state.push_back(a[i].pos);
                monit.push_back(a[i].monitors);
            }
        }
        bool flag=1;
        for(LL i=0; i<state.size(); i++)
        {
            for(LL j=0; j<state.size(); j++)
            {
                if((state[i]|state[j])>(1<<m))
                {
                    continue;
                }
                dp[state[i]|state[j]]=min(dp[state[i]|state[j]],dp[state[i]]+dp[state[j]]-min(monit[i],monit[j])*b);
                if((state[i]|state[j])==(1<<m)-1)
                {
                    flag=0;
                }
            }
        }
        LL ans=(1<<m)-1;
        //if(dp[ans]==0xffffffffffffff) printf("-1\n");
        if(flag) printf("-1\n");
        else printf("%I64d\n",dp[ans]);
    }
    return 0;
}


#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
#define LL long long
using namespace std;
vector<LL>state,monit;
const LL N=20;
LL dp[1<<N];
struct node
{
    LL requr,monitors,num,cnt,pos;
}a[25];
bool cmp(node a,node b)
{
    if(a.pos==b.pos) return a.cnt<b.cnt;
    else return a.pos<b.pos;
}
int main()
{
    LL n,m,b;;
    //n is the number of his friends,m is the number of problems,b is the cost of each monitor;
    while(~scanf("%I64d%I64d%I64d",&n,&m,&b))
    {
        state.clear();
        LL tmp,number;
        for(LL i=0; i<(1<<m); i++)
            dp[i]=0xfffffffffff;
        dp[0]=0;
        cout<<dp[(1<<m)-1]<<endl;

        for(LL i=0; i<n; i++)
        {
            tmp=0;
            scanf("%I64d%I64d%I64d",&a[i].requr,&a[i].monitors,&a[i].num);
            for(LL j=0; j<a[i].num; j++)
            {
                scanf("%I64d",&number);
                tmp+=(1<<(number)-1);
            }
            a[i].pos=tmp;
            a[i].cnt=a[i].requr+a[i].monitors*b;
        }
        sort(a,a+n,cmp);
        for(LL i=0; i<n; i++)
        {
            if(dp[a[i].pos]>a[i].cnt)
            {
                dp[a[i].pos]=min(a[i].cnt,dp[a[i].pos]);
                state.push_back(a[i].pos);
                monit.push_back(a[i].monitors);
            }
        }
        for(LL i=0; i<state.size(); i++)
        {
            for(LL j=0; j<state.size(); j++)
            {
                if((state[i]|state[j])>(1<<m))
                {
                    continue;
                }
                dp[state[i]|state[j]]=min(dp[state[i]|state[j]],dp[state[i]]+dp[state[j]]-min(monit[i],monit[j])*b);
            }
        }
        LL ans=(1<<m)-1;
        if(dp[ans]==0xfffffffffff) printf("-1\n");
        else printf("%I64d\n",dp[ans]);
    }
    return 0;
}


#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
ll f[2][1048576],g[2][1048576];
int x[maxn],k[maxn],s[maxn];
int n,m;
ll b,ans;

int main(){
  int ii,i,j,jj,mi,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&x[i],&k[i],&mi);
    s[i]=0;
    while (mi--){
      scanf("%d",&j);
      s[i]+=1<<(j-1);
    }
  }
  memset(f[0],-1,sizeof(f[0]));
  f[0][0]=0;
  state=1<<m;
  ans=-1;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    memset(f[ii],-1,sizeof(f[ii]));
    for (j=0;j<state;++j){
      jj=j|s[i];
      if (f[1-ii][j]>=0 && jj>j){
        if (g[1-ii][j]>=k[i]){
          ll temp=f[1-ii][j]+x[i];
          if (f[ii][jj]<0 || temp<=f[ii][jj]){
            f[ii][jj]=temp;
            g[ii][jj]=g[1-ii][j];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
        else {
          ll temp=f[1-ii][j]+x[i]+(k[i]-g[1-ii][j])*b;
          if (f[ii][jj]<0 || temp<f[ii][jj] ){
            f[ii][jj]=temp;
            g[ii][jj]=k[i];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
      }
    }
  }
  printf("%I64d\n",ans);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
const ll oo=1LL<<60;
struct  arr{
  int x,k,s;
  bool operator<(const arr &i)const{
    return k<i.k;
  }
}a[maxn];
ll f[1<<20],b,ans;
int n,m;

int main(){
  int i,j,jj,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&a[i].x,&a[i].k,&jj);
    a[i].s=0;
    while (jj--){
      scanf("%d",&j);
      a[i].s+=1<<(j-1);
    }
  }
  sort(a+1,a+n+1);
  state=1<<m;
  for (j=1;j<state;++j) f[j]=oo;
  ans=oo;
  for (i=1;i<=n;++i){
    for (j=0;j<state;++j){
      jj=j|a[i].s;
      f[jj]=min(f[jj],f[j]+a[i].x);
    }
    ans=min(ans,f[state-1]+a[i].k*b);
  }
  printf("%I64d\n",ans<oo?ans:-1);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
const ll oo=1LL<<62;
struct  arr{
  int x,k,s;
  bool operator<(const arr &i)const{
    return k<i.k;
  }
}a[maxn];
ll f[2][1048576];
int n,m;
ll b,ans;

int main(){
  int i,j,ii,jj,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&a[i].x,&a[i].k,&ii);
    a[i].s=0;
    while (ii--){
      scanf("%d",&j);
      a[i].s+=1<<(j-1);
    }
  }
  sort(a+1,a+n+1);
  state=1<<m;
  for (j=1;j<state;++j) f[0][j]=oo;
  f[0][0]=0;
  ans=oo;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    a[i].k-=a[i-1].k;
    for (j=0;j<state;++j)
      f[ii][j]=f[1-ii][j]+a[i].k*b;
    for (j=0;j<state;++j){
      jj=j|a[i].s;
      f[ii][jj]=min(f[ii][jj],f[1-ii][j]+a[i].x+a[i].k*b);
    }
    ans=min(ans,f[ii][state-1]);
  }
  if (ans<oo) printf("%I64d\n",ans);
  else puts("-1");
  return 0;
}


#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
ll f[2][1048576],g[2][1048576];
int x[maxn],k[maxn],s[maxn];
int n,m;
ll b,ans;

int main(){
  int ii,i,j,jj,mi,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&x[i],&k[i],&mi);
    s[i]=0;
    while (mi--){
      scanf("%d",&j);
      s[i]+=1<<(j-1);
    }
  }
  memset(f[0],-1,state*sizeof(int));
  f[0][0]=0;
  state=1<<m;
  ans=-1;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    memcpy(f[ii],f[1-ii],state*sizeof(int));
    for (j=0;j<state;++j){
      jj=j|s[i];
      if (f[1-ii][j]>=0 && jj>j){
        if (g[1-ii][j]>=k[i]){
          ll temp=f[1-ii][j]+x[i];
          if (f[ii][jj]<0 || temp<=f[ii][jj]){
            f[ii][jj]=temp;
            g[ii][jj]=g[1-ii][j];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
        else {
          ll temp=f[1-ii][j]+x[i]+(k[i]-g[1-ii][j])*b;
          if (f[ii][jj]<0 || temp<f[ii][jj] ){
            f[ii][jj]=temp;
            g[ii][jj]=k[i];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
      }
    }
  }
  printf("%I64d\n",ans);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
ll f[2][1048576],g[2][1048576];
int x[maxn],k[maxn],s[maxn];
int n,m;
ll b,ans;

int main(){
  int ii,i,j,jj,mi,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&x[i],&k[i],&mi);
    s[i]=0;
    while (mi--){
      scanf("%d",&j);
      s[i]+=1<<(j-1);
    }
  }
  memset(f[0],-1,sizeof(f[0]));
  f[0][0]=0;
  state=1<<m;
  ans=-1;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    memcpy(f[ii],f[1-ii],sizeof(f[0]));
    for (j=0;j<state;++j){
      jj=j|s[i];
      if (f[1-ii][j]>=0 && jj>j){
        if (g[1-ii][j]>=k[i]){
          ll temp=f[1-ii][j]+x[i];
          if (f[ii][jj]<0 || temp<=f[ii][jj]){
            f[ii][jj]=temp;
            g[ii][jj]=g[1-ii][j];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
        else {
          ll temp=f[1-ii][j]+x[i]+(k[i]-g[1-ii][j])*b;
          if (f[ii][jj]<0 || temp<f[ii][jj] ){
            f[ii][jj]=temp;
            g[ii][jj]=k[i];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
      }
    }
  }
  printf("%I64d\n",ans);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
ll f[2][1048576],g[2][1048576];
int x[maxn],k[maxn],s[maxn];
int n,m;
ll b,ans;

int main(){
  int ii,i,j,jj,mi,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&x[i],&k[i],&mi);
    s[i]=0;
    while (mi--){
      scanf("%d",&j);
      s[i]+=1<<(j-1);
    }
  }
  memset(f,-1,sizeof(f));
  f[0][0]=0;
  state=1<<m;
  ans=-1;
  for (ii=i=1;i<=n;++i,ii=1-ii)
    for (j=0;j<state;++j){
      jj=j|s[i];
      if (f[1-ii][j]>=0 && jj>j){
        if (g[1-ii][j]>=k[i]){
          ll temp=f[1-ii][j]+x[i];
          if (f[ii][jj]<0 || temp<=f[ii][jj]){
            f[ii][jj]=temp;
            g[ii][jj]=g[1-ii][j];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
        else {
          ll temp=f[1-ii][j]+x[i]+(k[i]-g[1-ii][j])*b;
          if (f[ii][jj]<0 || temp<f[ii][jj] ){
            f[ii][jj]=temp;
            g[ii][jj]=k[i];
            if ((jj==state-1) && (ans<0 || f[ii][jj]<ans)) ans=f[ii][jj];
          }
        }
      }
    }
  printf("%I64d\n",ans);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
ll f[2][1048576];
int x[maxn],k[maxn],s[maxn];
int n,m;
ll b,ans;

int main(){
  int ii,i,j,jj,mi,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&x[i],&k[i],&mi);
    s[i]=0;
    while (mi--){
      scanf("%d",&j);
      s[i]+=1<<(j-1);
    }
  }
  for (i=1;i<=n;++i)
    for (j=i+1;j<=n;++j)
      if (k[i]>k[j]){
        swap(x[i],x[j]);
        swap(k[i],k[j]);
        swap(s[i],s[j]);
      }
  state=1<<m;
  for (j=1;j<state;++j) f[0][j]=f[1][j]=-1;
  f[0][0]=0;
  ans=-1;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    for (j=0;j<state;++j)
      if (f[1-ii][j]>=0) f[ii][j]=f[1-ii][j]+(k[i]-k[i-1])*b;
    for (j=0;j<state;++j){
      jj=j|s[i];
      if (f[1-ii][j]>=0){
        ll temp=f[1-ii][j]+x[i]+(k[i]-k[i-1])*b;
        if (f[ii][jj]<0 || temp<f[ii][jj])
          f[ii][jj]=temp;
      }
    }
    if (f[ii][state-1]>=0 && (ans<0 || f[ii][state-1]<ans))
      ans=f[ii][state-1];
  }
  printf("%I64d\n",ans);
  return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=102;
const ll oo=1LL<<60;
struct  arr{
  int x,k,s;
  bool operator<(const arr &i)const{
    return k<i.k;
  }
}a[maxn];
ll f[2][1<<20];
ll b,ans;
int n,m;

int main(){
  int i,j,ii,jj,state;
  scanf("%d%d%I64d",&n,&m,&b);
  for (i=1;i<=n;++i){
    scanf("%d%d%d",&a[i].x,&a[i].k,&ii);
    a[i].s=0;
    while (ii--){
      scanf("%d",&j);
      a[i].s+=1<<(j-1);
    }
  }
  sort(a+1,a+n+1);
  state=1<<m;
  for (j=1;j<state;++j) f[0][j]=oo;
  f[0][0]=0;
  ans=oo;
  for (ii=i=1;i<=n;++i,ii=1-ii){
    for (j=0;j<state;++j)
      f[ii][j]=f[1-ii][j]+(a[i].k-a[i-1].k)*b;
    for (j=0;j<state;++j){
      jj=j|a[i].s;
      f[ii][jj]=min(f[ii][jj],f[1-ii][j]+a[i].x+(a[i].k-a[i-1].k)*b);
    }
    ans=min(ans,f[ii][state-1]);
  }
  if (ans<oo) printf("%I64d\n",ans);
  else puts("-1");
  return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
int n, m, b;
ll dp[(1<<20) + 12];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll state = (1<<m) - 1;
    ll ans = INF;

    for (int i = 0; i <= state; i++) {
        dp[i] = INF;
    }
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= state; j++) {
            dp[j|v[i].se.se] = min(dp[j|v[i].se.se], v[i].se.fr + dp[j]);
        }
        ans = min(ans, dp[state] + v[i].fr * b);
    }

    if (ans != INF)
    cout <<ans << endl;
    else cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
ll n, m, b;
ll dp[(1<<20) + 12];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll state = (1<<m) - 1;
    ll ans = INF;

    for (int i = 0; i <= state; i++) {
        dp[i] = INF;
    }
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (ll j = 0; j <= state; j++) {
            dp[j|v[i].se.se] = min(dp[j|v[i].se.se], v[i].se.fr + dp[j]);
        }
        ans = min(ans, dp[state] + v[i].fr * b);
    }

    if (ans >= INF || ans < 0)
    cout <<-1 << endl;
    else cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
ll n, m, b;
ll dp[(1<<20) + 12];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll state = (1<<m) - 1;
    ll ans = INF;

    for (int i = 0; i <= state; i++) {
        dp[i] = INF;
    }
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (ll j = 0; j <= state; j++) {
            dp[j|v[i].se.se] = min(dp[j|v[i].se.se], v[i].se.fr + dp[j]);
        }
        ans = min(ans, dp[state] + v[i].fr * b);
    }

    if (ans >= INF || ans < 0)
    cout <<ans << endl;
    else cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
int n, m, b;
ll dp[110][1<<20];

ll solve(int pos, ll mask)
{
    //cout << pos << " " << mask << endl;
    if (pos == n) {
        if (mask == (1 << m) - 1) return 0;
        else return INF;
    }

    if (dp[pos][mask] != -1) return dp[pos][mask];

    ll ans = INF;

    ans = min(ans, solve(pos + 1, mask));
    ll nmask= mask | v[pos].se.se;
    if(nmask != (1<<m)-1) ans = min(ans, v[pos].se.fr + solve(pos + 1, mask | v[pos].se.se));
    //cout << ans << endl;
    else ans =  v[pos].se.fr + v[pos].fr * b;
    return dp[pos][mask] = ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    mem(dp, -1);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll ans = solve(0, 0);
    if (ans != INF)
    cout <<ans << endl;
    else cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
ll n, m, b;
ll dp[(1<<20) + 12];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll state = (1<<m) - 1;
    ll ans = INF;

    for (int i = 0; i <= state; i++) {
        dp[i] = INF;
    }
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (ll j = 0; j <= state; j++) {
            dp[j|v[i].se.se] = min(dp[j|v[i].se.se], v[i].se.fr + dp[j]);
        }
        ans = min(ans, dp[state] + v[i].fr * b);
    }

    if (ans != INF)
    cout <<ans << endl;
    else cout << -1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <cstdlib>
#include <string>
#include <list>
#include <bitset>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <deque>
#include <climits>
#include <cassert>

using namespace std;

#define ull unsigned long long
#define ll long long
#define Max(x,y) ((x)>(y)?(x):(y))
#define Min(x,y) ((x)<(y)?(x):(y))
#define Sl(x) scanf("%lld",&x)
#define Su(x) scanf("%llu",&x)
#define S(x) scanf("%d",&x)
#define IS(x) cin>>x
#define ISF(x) getline(cin,x)
#define pii pair<int,int>
#define ppi pair<int, pii>
#define pll pair<ll,ll>
#define ppl pair<ll,pll>
#define ppf pair<pll,ll>
#define psi pair<string,int>
#define pis pair<int,string>
#define fr first
#define se second
#define MOD 1000000007
#define MP(x,y) make_pair(x,y)
#define eps 1e-7
#define V(x) vector<x>
#define pb(x) push_back(x)
#define mem(x,i) memset(x,i,sizeof(x))
#define fori(i,s,n) for(i=(s);i<(n);i++)
#define ford(i,s,n) for(i=(n);i>=(s);--i)
#define INF 8944674407370955161LL
#define debug(i,st,arr) fori(i,0,st){cout<<arr[i]<<" ";}cout<<endl;
#define forci(i,sw) for((i)=(sw).begin();(i)!=(sw).end();(i)++)
#define forcd(i,sw) for((i)=(sw).rbegin();(i)!=(sw).rend();(i)++)

int abs(int x) {if(x < 0) return -x; return x;}

ppl v[110];
ll n, m, b;
ll dp[(1<<20) + 12];

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> m >> b;
    for (int i = 0; i < n; i++) {
        ll xi, ki, mi, state = 0, val;
        cin >> xi >> ki >> mi;
        for (int j = 0; j < mi; j++) {
            cin >> val;
            val--;
            state |= (1<<val);
        }
        v[i] = ppl(ki, pll(xi, state));
    }
    sort(v, v+n);
    ll state = (1<<m) - 1;
    ll ans = INF;

    for (int i = 0; i <= state; i++) {
        dp[i] = INF;
    }
    dp[0] = 0LL;
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j <= state; j++) {
            dp[j|v[i].se.se] = min(dp[j|v[i].se.se], v[i].se.fr + dp[j]);
        }
        if (dp[state] + v[i].fr * b < 0ll) continue;
        ans = min(ans, dp[state] + v[i].fr * b);

    }
    if (ans == INF) cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<60)
int max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
    int n, m, b, i, j;
    scanf("%d %d %d",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        int x, sum = 0, y;
        scanf("%d %d %d",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%d",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(i=1;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    //  printf("%d %lld\n",i,dp[i]);
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(i=1;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    //  printf("%d %lld\n",i,dp[i]);
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }

    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=1;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
        //  printf("%lld %lld\n",i,j);
            dp[i]  = min(dp[i],sum);
            if(j==n&&dp[i]!=INF)
            {
                dp[i] = dp[i]+con[j]*b;
            }
        //  printf("%lld\n",dp[i]);
        }
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }

    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    __int64 ans = INF;
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=0;i<(1<<m);i++)
        {
            if(dp[i]==INF) continue;
            int u = i|aw[j];
            if(dp[u]==INF) dp[u] = dp[i]+price[j];
            else
            dp[u]  =  min(dp[u], dp[i]+price[j]);
        }
      //  printf("%lld %lld %lld\n",dp[(1<<m)-1],con[j],b);
        if(dp[(1<<m)-1]!=INF&&ans>dp[(1<<m)-1]+b*con[j])
        {
            ans  =dp[(1<<m)-1]+b*con[j];
        }
    }
    if(ans==INF)
     printf("-1\n");
    else
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
    printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(i=1;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    //  printf("%d %lld\n",i,dp[i]);
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<60)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(i=1;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    //  printf("%d %lld\n",i,dp[i]);
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=1;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=1;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }

    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
  for(j=1;j<=n;j++)
    {
        for(i=1;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }

    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    __int64 ans = INF;
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=0;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            if(dp[i^aw[j]]==INF) continue;
            if(dp[i]==INF) dp[i] = dp[i^aw[j]]+price[j];
            else  dp[i] = min(dp[i],dp[i^aw[j]]+price[j]);
        }
        if(dp[(1<<m)-1]!=INF&&ans>dp[(1<<m)-1]+b*con[j])
        {
            ans  =dp[(1<<m)-1]+b*con[j];
        }
    }
    if(ans==INF)
     printf("-1\n");
    else
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<61)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
//  printf("%lld\n",INF);
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%lld %lld %lld",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n-i;j++)
        {
            if(con[j]>con[j+1])
            {
                swap(con[j],con[j+1]);
                swap(price[j],price[j+1]);
                swap(aw[j],aw[j+1]);
            }
        }
    }

    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    __int64 ans = INF;
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(j=1;j<=n;j++)
    {
        for(i=1;i<(1<<m);i++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(dp[i]>sum) dp[i] = sum;
        }
      //  printf("%lld %lld %lld\n",dp[(1<<m)-1],con[j],b);
        if(dp[(1<<m)-1]!=INF&&ans>dp[(1<<m)-1]+b*con[j])
        {
            ans  =dp[(1<<m)-1]+b*con[j];
        }
    }
    if(ans==INF)
     printf("-1\n");
    else
    printf("%lld\n",ans);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxn (1<<21)
#define INF (1LL<<60)
__int64 max_con[maxn],aw[maxn],price[maxn],con[maxn];
__int64 dp[maxn];
int main()
{
    __int64 n, m, b, i, j;
    scanf("%lld %lld %lld",&n,&m,&b);
    for(i=1;i<=n;i++)
    {
        __int64 x, sum = 0, y;
        scanf("%d %d %d",&price[i],&con[i],&x);
        for(j=1;j<=x;j++)
        {
            scanf("%lld",&y);
            y--;
            sum|=(1<<y);
        }
        aw[i] = sum;
    }
    for(i=0;i<(1<<m);i++)
    {
        dp[i] = INF;
        max_con[i] = INF;
    }
    dp[0]  = 0;
    max_con[0] = 0;
//  printf("%d %d\n",aw[1],aw[2]);
    for(i=1;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {

            if((i|aw[j])!=i) continue;
            __int64 sum = dp[i^aw[j]]+price[j];
            if(max_con[i^aw[j]]<con[j]) sum+=(con[j]-max_con[i^aw[j]])*b;
            if(dp[i]>sum) dp[i] = sum,max_con[i] = max(max_con[i^aw[j]],con[j]);
        }
    //  printf("%d %lld\n",i,dp[i]);
    }
    if(dp[(1<<m)-1]==INF)
     printf("-1\n");
    else
    printf("%lld\n",dp[(1<<m)-1]);
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m)-1;i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)continue;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    return dp[(1<<m)-1];
}
bool cmp(point a,point b)
{
    return a.x<b.x;
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                if(!vis[t1])
                vis[t1]=p[i].k;
                else vis[t1]=min(vis[t1],p[i].k);
                p[i].w|=1<<(t1-1);
            }
        }
        long long maa=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            maa=max(maa,vis[i]);
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=maa;
        //printf("**%I64d\n",l);
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid&&l+1>=r)break;
        }
        printf("%I64d\n",t1);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 1000000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct pointt
{
    long long x,k,w;
}p[120];
long long n,m,b;
long long dp[(1<<20)+5][102];
bool cmp(pointt a,pointt b)
{
    return a.k<b.k;
}
void deel()
{
    long long i,j,t;
    for(i=1;i<=n;i++)
    {
        dp[0][i]=0;
        for(j=0;j<(1<<m);j++)
        {
            t=j|p[i].w;
            dp[j][i]=min(dp[j][i-1],dp[j][i]);
            if(t!=j)
            {
                dp[t][i]=min(dp[j][i]+p[i].x,dp[t][i]);
            }
        }
    }
}
long long vis[22];
int main()
{
    long long i,j,x,k,s,t,ma,mi;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        mi=inf;
        memset(vis,0,sizeof(vis));
        for(i=0;i<=1<<m;i++)
        {
            for(j=0;j<=n;j++)dp[i][j]=inf;
        }
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                scanf("%I64d",&t);
                if(!vis[t])
                {
                    vis[t]=k;
                }
                else
                {
                    vis[t]=min(vis[t],k);
                }
                p[i].w|=1<<(t-1);
            }

        }
        ma=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            ma=max(vis[i],ma);
        }
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        sort(p+1,p+n+1,cmp);
        p[0].k=-1;
        deel();
        for(i=1;i<=n;i++)
        {
            if(p[i].k>=ma)
            {
                mi=min(dp[(1<<m)-1][i]+b*p[i].k,mi);
            }
        }
        printf("%I64d\n",mi);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long deel(long long t)
{
    long long i,j;
    long long ans=0;
    memset(vis,0,sizeof(vis));
    for(i=1;i<=n;i++)
    {
        if(p[i].k<=t)
        for(j=0;j<m;j++)
        {
            if(!vis[j]&&p[i].w&(1<<j))
            {
                vis[j]=1;
                ans+=p[i].x;
            }
        }
    }
    for(i=0;i<m;i++)
    {
        if(!vis[i])return inf;
    }
    return ans;
}
bool cmp(point a,point b)
{
    if(a.x!=b.x)return a.x<b.x;
    return a.k<b.k;
}
int main()
{
    long long i,j,t,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        t=(1<<m)-1;
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                vis[t1]=1;
                p[i].w|=1<<(t1-1);
            }
        }
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=1;
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid)break;
        }
        printf("%I64d\n",t1);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m)-1;i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)break;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    return dp[(1<<m)-1];
}
bool cmp(point a,point b)
{
    return a.k<b.k;
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                if(!vis[t1])
                vis[t1]=p[i].k;
                else vis[t1]=min(vis[t1],p[i].k);
                p[i].w|=1<<(t1-1);
            }
        }
        long long maa=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            maa=max(maa,vis[i]);
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=maa;
        //printf("**%I64d\n",l);
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid&&l+1>=r)break;
        }
        printf("%I64d\n",t1);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m)-1;i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)continue;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    //if(dp[(1<<m)-1]==inf)while(1){}
    return dp[(1<<m)-1];
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                if(!vis[t1])
                vis[t1]=k;
                else vis[t1]=min(vis[t1],k);
                p[i].w|=1<<(t1-1);
            }
        }
        long long maa=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            maa=max(maa,vis[i]);
        }
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=maa;
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>=inf||t2>=inf)while(1){}
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(l==mid&&midmid==l)break;
        }
        t1=deel(l)+l*b;
        t2=deel(r)+r*b;
        printf("%I64d\n",min(t1,t2));
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 2000000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct pointt
{
    long long x,k,w;
}p[120];
long long n,m,b;
long long dp[(1<<20)+5][2],e;
bool cmp(pointt a,pointt b)
{
    return a.k<b.k;
}
void deel(long long i)
{
    long long j,t;
    for(j=0;j<=(1<<m);j++)dp[j][e^1]=inf;
    dp[0][e^1]=0;
    for(j=0;j<(1<<m);j++)
    {
            t=j|p[i].w;
            dp[j][e^1]=min(dp[j][e],dp[j][e^1]);
            if(t!=j)
            {
                dp[t][e^1]=min(dp[j][e^1]+p[i].x,dp[t][e^1]);
            }
        }
    e^=1;
}
long long vis[22];
int main()
{
    long long i,j,x,k,s,t,ma,mi;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        mi=inf;
        e=0;
        memset(vis,0,sizeof(vis));
        for(i=0;i<=1<<m;i++)
        {
            dp[i][0]=inf;
        }
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                scanf("%I64d",&t);
                if(!vis[t])
                {
                    vis[t]=k;
                }
                else
                {
                    vis[t]=min(vis[t],k);
                }
                p[i].w|=1<<(t-1);
            }

        }
        ma=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            ma=max(vis[i],ma);
        }
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        sort(p+1,p+n+1,cmp);
        for(i=1;i<=n;i++)
        {
            deel(i);
            if(p[i].k>=ma)
            {

                mi=min(mi,dp[(1<<m)-1][e]+p[i].k*b);
            }
        }
        printf("%I64d\n",mi);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m)-1;i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)continue;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    return dp[(1<<m)-1];
}
bool cmp(point a,point b)
{
    return a.x<b.x;
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                if(!vis[t1])
                vis[t1]=p[i].k;
                else vis[t1]=min(vis[t1],p[i].k);
                p[i].w|=1<<(t1-1);
            }
        }
        long long maa=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            maa=max(maa,vis[i]);
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=maa;
        //printf("**%I64d\n",l);
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid&&l==mid&&midmid==r)break;
        }
        printf("%I64d\n",t1);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 1000000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct pointt
{
    long long x,k,w;
}p[120];
long long n,m,b;
long long dp[(1<<20)+5][2],e;
bool cmp(pointt a,pointt b)
{
    return a.k<b.k;
}
void deel(long long i)
{
    long long j,t;
    for(j=0;j<=(1<<m);j++)dp[j][e^1]=inf;
    dp[0][e^1]=0;
    for(j=0;j<(1<<m);j++)
    {
            t=j|p[i].w;
            dp[j][e^1]=min(dp[j][e],dp[j][e^1]);
            if(t!=j)
            {
                dp[t][e^1]=min(dp[j][e^1]+p[i].x,dp[t][e^1]);
            }
        }
    e^=1;
}
long long vis[22];
int main()
{
    long long i,j,x,k,s,t,ma,mi;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        mi=inf;
        e=0;
        memset(vis,0,sizeof(vis));
        for(i=0;i<=1<<m;i++)
        {
            dp[i][0]=inf;
        }
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                scanf("%I64d",&t);
                if(!vis[t])
                {
                    vis[t]=k;
                }
                else
                {
                    vis[t]=min(vis[t],k);
                }
                p[i].w|=1<<(t-1);
            }

        }
        ma=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            ma=max(vis[i],ma);
        }
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        sort(p+1,p+n+1,cmp);
        for(i=1;i<=n;i++)
        {
            deel(i);
            if(p[i].k>=ma)
            {

                mi=min(mi,dp[(1<<m)-1][e]+p[i].k*b);
            }
        }
        printf("%I64d\n",mi);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m);i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)break;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    return dp[(1<<m)-1];
}
bool cmp(point a,point b)
{
    return a.k<b.k;
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                vis[t1]=1;
                p[i].w|=1<<(t1-1);
            }
        }
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=1;
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid)break;
        }
        printf("%I64d\n",t1);
    }
    return 0;
}


#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <string>
#define sqr(x) ((x)*(x))
#define X first
#define Y second
#define N 100005
#define mod 1000000007
#define inf 100000000000000000LL
#define eps 1e-9
#define pi acos(-1.0)
using namespace std;
struct point
{
    long long x,k,m,w;
}p[120];
long long n,m,b;
long long vis[22];
long long dp[(1<<20)+5];
long long deel(long long t)
{
    long long i,j,tt;
    for(i=0;i<=(1<<m)+2;i++)dp[i]=inf;
    dp[0]=0;
    for(i=0;i<(1<<m)-1;i++)
    {
        for(j=1;j<=n;j++)
        {
            if(p[i].k>t)continue;
            tt=i|p[j].w;
            if(i!=tt)
            {
                dp[tt]=min(dp[tt],dp[i]+p[j].x);
            }
        }
    }
    return dp[(1<<m)-1];
}
bool cmp(point a,point b)
{
    return a.x<b.x;
}
int main()
{
    long long i,j,x,k,s,l,r,mid,midmid,ma,t1,t2;
    //freopen("in.txt","r",stdin);
    while(scanf("%I64d%I64d%I64d",&n,&m,&b)!=EOF)
    {
        ma=0;
        memset(vis,0,sizeof(vis));
        for(i=1;i<=n;i++)
        {
            scanf("%I64d%I64d%I64d",&x,&k,&s);
            p[i].x=x;
            p[i].k=k;
            ma=max(p[i].k,ma);
            p[i].w=0;
            for(j=0;j<s;j++)
            {
                long long t1;
                scanf("%I64d",&t1);
                if(!vis[t1])
                vis[t1]=p[i].k;
                else vis[t1]=min(vis[t1],p[i].k);
                p[i].w|=1<<(t1-1);
            }
        }
        long long maa=0;
        for(i=1;i<=m;i++)
        {
            if(!vis[i])break;
            maa=max(maa,vis[i]);
        }
        sort(p+1,p+n+1,cmp);
        if(i<=m)
        {
            printf("-1\n");continue;
        }
        l=maa;
        //printf("**%I64d\n",l);
        r=ma+1;
        while(1)
        {
            mid=(l+r)/2;
            midmid=(mid+r)/2;
            t1=deel(mid)+mid*b;
            t2=deel(midmid)+midmid*b;
            if(t1>t2)
            {
                l=mid;
            }
            else r=midmid;
            if(t1==t2&&mid==midmid&&l==mid&&midmid==r)break;
        }
        t1=deel(l)+l*b;
        t2=deel(r)+r*b;
        printf("%I64d\n",min(t1,t2));
    }
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
	ans=INF*1ll*INF;
	sort(a+1,a+1+n);
	for(i=1;i<(1<<m);++i)
		d[0][i]=INF*1ll*INF;
    for(i=1;i<=n;++i)
    {
		for(j=0;j<(1<<m);++j)
			d[i&1][j]=INF*1ll*INF;
        int tmp=0;
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
		ans=-1;
    cout<<ans;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
ans=INF*1ll*INF;
    sort(a+1,a+1+n);
for(i=1;i<(1<<m);++i)
d[0][i]=INF*1ll*INF;
    for(i=1;i<=n;++i)
    {
        int tmp=0;
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
    {
        cout<<-1;
    }
    else
    cout<<ans;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
ans=INF*1ll*INF;
    sort(a+1,a+1+n);
for(i=1;i<(1<<m);++i)
d[0][i]=d[1][i]=INF*1ll*INF;
d[1][0]=INF*1ll*INF;
    for(i=1;i<=n;++i)
    {
        int tmp=0;
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
    {
        cout<<-1;
    }
    else
    cout<<ans;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
ans=INF*1ll*INF;
    sort(a+1,a+1+n);
for(i=1;i<(1<<m);++i)
d[0][i]=d[1][i]=INF*1ll*INF;
    for(i=1;i<=n;++i)
    {
        int tmp=0;
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
    {
        cout<<-1;
    }
    else
    cout<<ans;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
	ans=INF*1ll*INF;
	sort(a+1,a+1+n);

	for(i=1;i<(1<<m);++i)
		d[0][i]=INF*1ll*INF;

    for(i=1;i<=n;++i)
    {
		for(j=0;j<(1<<m);++j)
			d[i&1][j]=d[(i+1)&1][j];
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
		ans=-1;
    cout<<ans;
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<vector>
#include<cassert>
#include<string>
#include<math.h>
using namespace std;

#define INF 2000000000
#define lint long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007

struct st
{
    lint c;
    lint m;
    int xnd;
};
bool operator < (st a,st b)
{
    return a.m<b.m;
}
st a[200];
lint d[2][1<<21],ans=0;
int main()
{
    int n,m,cnt,i,j,f;
    lint x,k,b;
    cin>>n>>m>>b;
    for(i=1;i<=n;++i)
    {
        cin>>x>>k>>cnt;
        for(j=0;j<cnt;++j)
        {
            cin>>f;
            a[i].xnd|=(1<<(f-1));
        }
        a[i].c=x;
        a[i].m=k;
    }
	ans=INF*1ll*INF;
	sort(a+1,a+1+n);

	for(i=1;i<(1<<m);++i)
		d[0][i]=INF*1ll*INF;

    for(i=1;i<=n;++i)
    {
		for(j=1;j<(1<<m);++j)
			d[i&1][j]=INF*1ll*INF;
        for(j=0;j<(1<<m);++j)
        {
            if(d[i&1][j|a[i].xnd]>d[(i+1)&1][j]+a[i].c)
            {
                d[i&1][j|a[i].xnd]=d[(i+1)&1][j]+a[i].c;
            }
        }
        if(ans>d[i&1][-1+(1<<m)]+a[i].m*1ll*b)
        {
            ans=d[i&1][-1+(1<<m)]+a[i].m*1ll*b;
        }
    }
    if(ans==INF*1ll*INF)
		ans=-1;
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
ll cost [(1ll << 21 ) ]= {};
ll vis [(1ll << 21 )]  ;
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base [109],needs ;

int main ()
{
    read () ;

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    needs.resize (unique ( needs.begin () , needs.end () )  - needs.begin());
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;
    memset ( vis , -1, sizeof ( vis ));

    int need , tar , tmp , sz , pro;
    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base[t].PB(0);
            need = needs [t] ;

       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
             tar = bitmask [i] ;
            tmp = pri [i] ;
            sz  = base[t].size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
                pro = base[t] [j]  | tar ;
               if (vis [pro] != t )
               {
                   base[t].PB(pro);
                   vis [pro] = t ;
                   cost [ pro ] = cost [base [t][j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base[t] [j]] + tmp );
               }
           }

       }
          if( vis [goal] == t )
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 4
using namespace std;
void read ( ll a = 0 ){  freopen ("in","r",stdin);  if (a)freopen ("out","w",stdout);}

ll cost [(1ll << 21 ) ] = {};
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base ,needs ;

int main ()
{

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;

    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base.clear () ;
          base.PB(0);
          memset ( cost , 0 , sizeof ( cost ) );
          int need = needs [t] ;
       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
           ll tar = bitmask [i] ;
           ll tmp = pri [i] ;
           int sz  = base.size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
               ll pro = base [j]  | tar ;
               if (!cost [pro])
               {
                   base.PB(pro);
                   cost [ pro ] = cost [base [j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base [j]] + tmp );
               }
           }

       }
          if( cost [goal])
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
ll cost [(1ll << 21 ) ]= {};
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base [109],needs ;

int main ()
{
    //read () ;

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    needs.resize (unique ( needs.begin () , needs.end () )  - needs.begin());
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;

    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base[t].PB(0);
          int need = needs [t] ;
          memset  ( cost , 0 , sizeof ( cost));
       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
           ll tar = bitmask [i] ;
           ll tmp = pri [i] ;
           int sz  = base[t].size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
               ll pro = base[t] [j]  | tar ;
               if (!cost [pro])
               {
                   base[t].PB(pro);
                   cost [ pro ] = cost [base [t][j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base[t] [j]] + tmp );
               }
           }

       }
          if( cost [goal])
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
ll cost [(1ll << 21 ) ]= {};
ll vis [(1ll << 21 )]  ;
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base [109],needs ;

int main ()
{
    read () ;

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }

    needs.resize (unique ( needs.begin () , needs.end () )  - needs.begin());
    sort  ( needs.rbegin ()  , needs.rend () );
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;
    memset ( vis , -1, sizeof ( vis ));

    int need , tar , tmp , sz , pro;
    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base[t].PB(0);
            need = needs [t] ;

       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
             tar = bitmask [i] ;
            tmp = pri [i] ;
            sz  = base[t].size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
                pro = base[t] [j]  | tar ;
               if (vis [pro] != t )
               {
                   base[t].PB(pro);
                   vis [pro] = t ;
                   cost [ pro ] = cost [base [t][j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base[t] [j]] + tmp );
               }
           }

       }
          if( vis [goal] == t )
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
          else break ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1e17
using namespace std;
void read ( ll a = 0 ){  freopen ("in","r",stdin);  if (a)freopen ("out","w",stdout);}

ll cost [(1ll << 21 ) ] = {};
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base ,needs ;

int main ()
{

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;

    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base.clear () ;
          base.PB(0);
          memset ( cost , 0 , sizeof ( cost ) );
          int need = needs [t] ;
       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
           ll tar = bitmask [i] ;
           ll tmp = pri [i] ;
           int sz  = base.size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
               ll pro = base [j]  | tar ;
               if (!cost [pro])
               {
                   base.PB(pro);
                   cost [ pro ] = cost [base [j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base [j]] + tmp );
               }
           }

       }
          if( cost [goal])
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
ll cost [(1ll << 21 ) ]= {};
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base [109],needs ;

int main ()
{
    read () ;

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    needs.resize (unique ( needs.begin () , needs.end () )  - needs.begin());
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;

    int need , tar , tmp , sz , pro;
    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base[t].PB(0);
            need = needs [t] ;
          memset  ( cost , 0 , sizeof ( cost));
       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
             tar = bitmask [i] ;
            tmp = pri [i] ;
            sz  = base[t].size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
                pro = base[t] [j]  | tar ;
               if (!cost [pro])
               {
                   base[t].PB(pro);
                   cost [ pro ] = cost [base [t][j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base[t] [j]] + tmp );
               }
           }

       }
          if( cost [goal])
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
pair < ll , pair < ll , ll > > a [109 ];
ll dp [( 1 << 21)] = {} ;
int main ()
{
    read () ;
    ll n , m  , b ;
    cin >> n >> m >> b ;

    for ( int i =0  ; i < n ; i ++ )
    {
        cin >> a[i].s.f >> a[i].f ;
        ll x;
        cin >> x;

        while ( x -- )
        {
            ll tmp ;
            cin >> tmp ;
            a[i].s.s |= ( 1 << ( tmp -1));
        }
    }
    sort ( a , a+n) ;
    ll ans = inf ;
    for ( int i= 0 ; i < ( 1 << 21) ; i ++ ) dp[ i] = inf ;
    dp[0] = 0 ;
    for ( int i = 0 ; i < n ; i ++ )
    {
        for ( int j = 0 ;  j < ( 1 << m ) ; j ++  )
                    dp[j | a[i].s.s] = min ( dp [j | a[i].s.s] , dp[j] + a[i].s.f  );
        ans = min ( ans ,dp[ ( 1 << ( m) ) -  1] + b *  a[i].f);

    }
    if ( ans < inf) cout << ans ;
    else cout << -1 ;
}


#include <bits/stdc++.h>
#define ll long long
#define MP make_pair
#define PB push_back
#define N 100009
#define MOD 1000000007
#define f first
#define s second
#define wt(x) cout << # x <<" = " << x << endl
#define FASTIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define endl "\n"
#define inf 1ll * 1e18 * 2
using namespace std;
void read(bool outToFile = 0){
#ifndef ONLINE_JUDGE
    freopen("in", "rt", stdin);
    if(outToFile)
    freopen("out", "wt", stdout);
#endif
}
ll cost [(1ll << 21 ) ] = {};
int pri [ 109] , ro [109] , bitmask [109] ;
vector < int > base ,needs ;

int main ()
{
    read () ;

    int n , m , b ;
    scanf ("%d %d %d\n" ,& n ,& m , & b );
    for( int i =0  ;i < n ; i ++ )
    {
        int x;
        scanf ("%d %d %d\n" ,& pri[i] ,& ro[i] , & x );
        needs.PB(ro[i]);
        while ( x -- )
        {
            int tmp ;
            scanf("%d" , & tmp );
            bitmask [i] |= (  1 << ( tmp - 1 ));
        }
    }
    sort  ( needs.begin ()  , needs.end () );
    needs.resize (unique ( needs.begin () , needs.end () )  - needs.begin());
    int goal = ( 1 << m)  -  1 ;

    ll ans = inf ;

    for( int t = 0 ; t < needs.size () ; t ++ )
    {
          base.clear () ;
          base.PB(0);
          memset ( cost , 0 , sizeof ( cost ) );
          int need = needs [t] ;
       for ( int i =0  ;i < n ; i ++ )
       {
           if ( ro[i] > need) continue ;
           ll tar = bitmask [i] ;
           ll tmp = pri [i] ;
           int sz  = base.size () ;
           for( int j = 0 ; j < sz ; j ++ )
           {
               ll pro = base [j]  | tar ;
               if (!cost [pro])
               {
                   base.PB(pro);
                   cost [ pro ] = cost [base [j]] + tmp ;
               }
               else
               {
                   cost [ pro ]  = min  ( cost [ pro ] , cost [base [j]] + tmp );
               }
           }

       }
          if( cost [goal])
              ans =min ( ans , cost [goal]  + 1ll * need * b ) ;
    }

    if  ( ans < inf )
        printf ("%lld\n" ,ans );
    else
        puts ("-1");

}