//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>

using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>
//
//using namespace __gnu_pbds;
//typedef tree<int, null_type, less<>, rb_tree_tag,
//        tree_order_statistics_node_update>
//        indexed_set;

#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) (int((x.size())))
#define fi first
#define se second
#define REP(i, a, b) for (int (i)=(a);(i)<(b);(i)++)
#define PER(i, a, b) for (int (i)=(b)-1;(i)>=(a);(i)--)

typedef long double ld;
typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<PII> VPI;

#ifdef qwerty
#define dbb(x)        { cerr << #x << " = " << x << "\t";      }
#define db(x)        { dbb(x); cerr << endl; }
#define db2(x, y)    { dbb(x); dbb(y); cerr << endl; }
#define db3(x, y, z)    { dbb(x); dbb(y); dbb(z); cerr << endl; }
#else
#define dbb(x)	404;
#define db(x)	404;
#define db2(x,y) 404;
#define db3(x,y,z)	404;
#endif


const ll MOD = 1000000007ll;

ll powmod(ll a, ll b) {
    ll res = 1;
    a %= MOD;
    assert(b >= 0);
    for (; b; b >>= 1) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD;
    }
    return res;
}

template<typename t1, typename t2>
inline bool upmax(t1 &a, t2 b) {
    if (a < (t1) b) {
        a = (t1) b;
        return true;
    } else return false;
}

template<typename t1, typename t2>
inline bool upmin(t1 &a, t2 b) {
    if (a > (t1) b) {
        a = (t1) b;
        return true;
    } else return false;
}

template<typename T>
inline T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

template<typename T>
inline T lcm(T a, T b) { return a * (b / gcd(a, b)); }

template<typename T>
inline T sqr(T a) { return a * a; }

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

const int INF = 1000000404;
const ll LINF = 1e18 * (1ll);
const ld PI = 3.14159265358979323846;
const ld EPS = 1e-9;

const int SQ = 318;
int timer = 0;


const int a_lot_of_test = 0;
#define N 15

int c[N];
int b[N];
int a[N][N];

void solve() {
    int n, m;
    cin >> n >> m;
    int X;
    cin >> X;

    REP(i, 0, n) {
        cin >> c[i];
        REP(j, 0, m) {
            cin >> a[i][j];
        }
    }

    int best = INF;
    int bestmask = 0;

    REP(mask, 0, (1 << n)) {
        int s = 0;
        REP(i, 0, m) b[i] = 0;
        REP(i, 0, n) {
            if (mask & (1 << i)) {
                s += c[i];
                REP(j, 0, m) {
                    b[j] += a[i][j];
                }
            }
        }
        bool good = true;
        REP(i, 0, m) {
            if (b[i] < X) good = false;
        }
        if (good && best > s) {
            best = s;
            bestmask = mask;
        }

    }

    if (bestmask == 0) {
        cout << -1 << endl;
    } else {
        cout << best << endl;
    }
}

int main() {

#ifdef qwerty
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("input.in", "r", stdin);
    //freopen("output.out", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int t = 1;
    if (a_lot_of_test) cin >> t;
    for (int i = 1; i <= t; i++) {
        solve();
    }


    return 0;
}

Measured memory_bytes: 3648