#include <iostream>
#include <vector>
#include <cmath>
#include <bitset>
 
using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    
    int N, M, X;
    cin >> N >> M >> X;
    
    vector<int> c(N, 0);
    vector<int> money;
    int** A = new int*[N];
    
    for(int i=0; i<N; i++){
        cin >> c[i];
        A[i] = new int[M];
        for(int j=0; j<M; j++){
            cin >> A[i][j];
        }
    }
    
    
    for(int tmp=0; tmp < (1 << 12); tmp++){
        bitset<12> s(tmp);
    
        int m=0;
        vector<int> skill(M,0);
        for(int i=0; i<12; i++){
            if(i>=N) continue;
            if(s.test(i)==1){
                for(int j=0; j<M; j++){
                    skill[j]+=A[i][j];
                }
                m += c[i];
            }
        }
        
        int count=0;
        for(int i=0; i<M; i++){
            if(skill[i]>=X){
                count+=1;
            }
        }
        
        if(count>=M){
            money.push_back(m);
        }
    }
    
    if(money.size() > 0){
        int ans=100000;
        for(int i=0; i<money.size(); i++){
            ans=min(ans, money[i]);
        }
        cout << ans << endl;
    }else{
        cout << "-1" << endl;
    }
    
    for(int i=0; i<N; i++){
        delete A[i];
    }
    delete[] A;
    
    return 0;
}
