#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <fstream>
#include <tuple>

//....................................................................................................................//

using std::cin;
using std::cout;
using std::vector;
using std::list;
using std::unordered_set;
using std::set;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::pair;
using std::make_pair;
using std::min;
using std::max;
using std::swap;
using std::stack;
using std::deque;
using std::queue;
using std::ios_base;
using std::ifstream;
using std::ofstream;
using std::string;
using std::tuple;
using std::make_tuple;
using std::get;
using std::upper_bound;
using std::lower_bound;
using std::max_element;
using std::min_element;
using std::multiset;
using std::greater;
using std::priority_queue;
using std::less;

//....................................................................................................................//

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned long ul;

[[maybe_unused]] const string endl = "\n";
[[maybe_unused]] const string sep = " ";
[[maybe_unused]] const string yes = "YES\n";
[[maybe_unused]] const string no = "NO\n";
[[maybe_unused]] const string ng = "NG\n";
[[maybe_unused]] const string ok = "OK\n";
[[maybe_unused]] const double pi = acos(-1);
[[maybe_unused]] const ull modular = 998244353;

//....................................................................................................................//

ll fill_H(ll n, ll m, ll k, vector<vector<ll>> &H) {
    if (n < 0 || k < 0) {
        return 0;
    }
    if (H[n][k] != -1) {
        return H[n][k];
    }
    H[n][k] = (fill_H(n - 1, m, k - 1, H) + (m - 1) * fill_H(n - 1, m, k, H)) % modular;
    return H[n][k];
}

int main() {
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout.precision(10);
//    ll n, m, k;
//    cin >> n >> m >> k;
//    vector<vector<ll>> H(n + 1, vector<ll>(k + 1, -1));
//    H[1][0] = m;
//    ll sum = 0;
//    for (int i = 0; i <= k; ++i) {
//        sum += fill_H(n, m, i, H);
//        sum %= modular;
//    }
//    cout << sum;
    ll n, m, x;
    cin >> n >> m >> x;
    vector<ll> C(n);
    vector<vector<ll>> A(n, vector<ll>(m));
    for (int i = 0; i < n; ++i) {
        cin >> C[i];
        for (int j = 0; j < m; ++j) {
            cin >> A[i][j];
        }
    }
    ll min_sum = -1;
    vector<char> X(n, 0);
    for (ll i = 0; i < (1ll << n); ++i) {
        ll j = i;
        for (int k = 0; k < n; ++k) {
            X[k] = j % 2;
            j /= 2;
        }
        ll sum = 0;
        bool h = true;
        vector<ll> Z(m);
        for (int iter = 0; iter < n; ++iter) {
            sum += X[iter] * C[iter];
            for (int l = 0; l < m; ++l) {
                Z[l] += A[iter][l] * X[iter];
            }
        }
        for (int iter = 0; iter < m; ++iter) {
            if (Z[iter] < x) {
                h = false;
            }
        }
        if (h) {
            if (min_sum == -1) {
                min_sum = sum;
            } else {
                min_sum = min(min_sum, sum);
            }
        }
    }
    cout << min_sum;
}


Measured memory_bytes: 3192