program test
	implicit none
	integer i,j,bit
	integer :: n=0,m=0,x=0, ans=100000000, money=0,count=0
	integer :: a(13,13)=0,c(13)=0, summ(13)=0
	integer, allocatable :: tmp(:)
    read (*,*) n,m,x
    allocate(tmp(m+1))
    do i=1,n
    	read *, tmp
    	c(i)=tmp(1)
    	do j=1,m
    		a(j,i)=tmp(j+1)
    	end do
    end do
    do bit=0,lshift(1,n)-1
    	do i=1,13
    		summ(i)=0
    	end do
    	money=0
    	do i=1,n
    		if(and(bit, lshift(1,i-1))/=0) then
    			do j=1,m
    				summ(j)=summ(j)+a(j,i)
    			end do
    			money=money+c(i)
    		end if
    	end do
    	do i=1,m
    		if(summ(i)<x) exit
    		count=count+1
    	end do
    	if(count==m) ans=min(ans,money)
    	count=0
    end do
    if(ans==100000000) then
    	write (*,'(i0)') -1
    else 
    	write (*,'(i0)') ans
    end if
    deallocate(tmp)
end program test