#include <bits/stdc++.h>
//                    #include <ext/pb_ds/assoc_container.hpp>
//                    #include <ext/pb_ds/tree_policy.hpp>

                    using ll = long long;
                    using ld = long double;
                    #define rep(i, a, n) for(ll i = (a); i < (n); i++)
                    #define per(i, a, n) for(ll i = (n-1); i >= (a); i--)
                    #define F first
                    #define S second
                    #define maxx(a, b) a = max(a, b)
                    #define minn(a, b) a = min(a, b)
                    #define db(x) cerr << #x << " = " << x << endl
                    #define N 1111111
                    #define mod 1000000007
                    #define rt return
                    #define inf 123456789123456789ll

                    using namespace std;
                    random_device rd;
                    mt19937 mt(rd());
//                    using namespace __gnu_pbds;
//
//                    typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

                    #define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

                    void err(istream_iterator<string> it) {}
                    template<typename T, typename... Args>
                    void err(istream_iterator<string> it, T a, Args... args)
                    {
                        cerr << *it << " = " << a << endl;
                        err(++it, args...);
                    }

                    ll modlaber(ll a, ll m = mod)
                    {
                        rt ((a+m)%m+m)%m;
                    }

                    int main()
                    {
                        ios_base::sync_with_stdio(0);
                        cin.tie(0);
                        cout.tie(0);

                        ll n,m,ch; cin>>n>>m>>ch;

                        bitset<15> b;

                        vector<ll> c(n);
                        vector<vector<ll>> v(n,vector<ll>(m));

                        rep(i,0,n)
                        {
                            cin>>c[i];
                            for(auto &x: v[i])
                                cin>>x;
                        }

                        ll ans = inf;

                        rep(i,0,1<<n)
                        {
                            b = i;
                            vector<ll> temp(m);
                            ll ras = 0;
                            rep(j,0,n)
                            {
                                if(b[j])
                                {
                                    rep(k,0,m)
                                        temp[k] += v[j][k];
                                    ras += c[j];
                                }
                            }
                            if(*min_element(begin(temp),end(temp)) >= ch)
                                minn(ans, ras);
                        }

                        cout<<(ans == inf ? -1 : ans);

                        rt 0;
                    }















Measured memory_bytes: 3592