program ABC167_C
  integer(8)::N,M,X,cost,ans=10000000
  integer(8),allocatable::C(:),A(:,:),S(:)
  read(*,*)N,M,X
  allocate(C(N),A(N,M),S(M))
  do i=1,N
     read(*,*)C(i),A(i,:)
  end do
  do i=0,2**N-1
     S=0
     cost=0
     do j=0,N-1
        if(btest(i,j)) then  !iのj+1番目が1なら真
           do k=1,m
              S(k)=S(k)+A(j+1,k)
           end do
           cost=cost+C(j+1)
        end if
        if(minval(S)>=X) ans=min(cost,ans)
     end do
  end do
  if(ans==10000000) then
     write(*,*)'-1'
  else
     write(*,*)ans
  end if
end program ABC167_C