/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template


signed main(void) {
    Ciniii(numBook,numAlgo,X);
    vector<int> price(numBook);
    vector<vector<int>> additional(numBook,vector<int>(numAlgo,0));
    rep(i,numBook){
        cin >> price[i];
        rep(j,numAlgo){
            cin >> additional[i][j];
        }
    }
    vector<int> minPrice;
    minPrice.push_back(100000000);
    int start = pow(2,numBook)-1;
    while(start>0){
        int target = start;
        vector<int> bit;
        while(target>0){
            bit.push_back(target%2);
            target -= target%2;
            target /= 2;
        }
        int tempPrice = 0;
        vector<int> tempX(numAlgo,0);
        for(int i=0;i<bit.size();i++){
            if(bit[i]==0) continue;
            tempPrice+=price[i];
            for(int j=0;j<numAlgo;j++){
                tempX[j] += additional[i][j];
            }
        }
        bool ok = true;
        for(int i=0;i<numAlgo;i++){
            if(tempX[i]<X) ok = false;
        }
        if(ok) minPrice.push_back(tempPrice);
        start--;
    }
    if(minPrice.size()>1) cout << *min_element(All(minPrice)) << endl;
    else cout << -1 << nn;
    return 0;
}

Measured memory_bytes: 3096