#include<stdio.h>
#include<math.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
const int INF=0x7f7f7f7f;
int min(int x,int y){return(x<y)?x:y;}
int main(void)
{
  int N,M,X,check,cost,C[12]={0},A[12][12]={0},skill[12]={0},total=INF;
  check=scanf("%d %d %d",&N,&M,&X);
  rep(i,N){check=scanf("%d",&C[i]);rep(j,M)check=scanf("%d",&A[i][j]);}
  for(int bit=pow(2,N)-1;~bit;bit--)
  {
    cost=0;rep(i,M)skill[i]=0;
    rep(i,N)if(bit&(int)pow(2,i)){cost+=C[i];rep(j,M)skill[j]+=A[i][j];}
    check=1;rep(i,M)if(skill[i]<X){check=0;break;}
    if(check)total=min(total,cost);
  }
  return printf("%d\n",total==INF?-1:total),0;
}