using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;

namespace AtCoder
{
    static class Program_D
    {
        class Solver
        {
            private int[] _buy;
            private int _n;
            private int _m;
            private int _x;
            private int[][] _books;
            List<int> _costs = new List<int>();

            public void Solve()
            {
                var nmx = Ints(0);
                _n = nmx[0];
                _m = nmx[1];
                _x = nmx[2];
                _books = new int[_n][];
                for(int i = 0; i < _n; ++i)
                {
                    _books[i] = Ints(0);
                }
                _buy = new int[_n];
                Calc(0);

                if(_costs.Count==0)
                {
                    Console.WriteLine(-1);
                }
                else
                {
                    Console.WriteLine(_costs.Min());
                }
            }

            void Check()
            {
                Twl(string.Join(" ", _buy.Select(b => b.ToString()).ToArray()));
                var rikai = new int[_m];
                var cost = 0;
                for(int i =0;i<_n;++i)
                {
                    cost += _books[i][0]*_buy[i];
                    for(int j=1;j<=_m;++j)
                    {
                        rikai[j - 1] += _books[i][j]*_buy[i];
                    }
                }
                if (rikai.All(r => r >= _x))
                {
                    Twl(string.Format("cost {0} ok",cost));
                    _costs.Add(cost);
                }
            }

            void Calc (int idx)
            {
                if (idx == _n)
                {
                    // 計算する
                    Check();
                    return;
                }
                _buy[idx] = 0;
                Calc(idx + 1);
                _buy[idx] = 1;
                Calc(idx + 1);
            }



            // ----------------------------------------------------------------------------
            void Twl(string mes)
            {
                //Console.WriteLine(mes);
            }

            public int Int()
            {
                return int.Parse(Console.ReadLine());
            }
            public int[] Ints(int subtract)
            {
                return Console.ReadLine().Split(' ').Select(s => int.Parse(s) - subtract).ToArray();
            }
            public long[] Longs()
            {
                return Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
            }
        }



        static void Main(string[] args)
        {
            new Solver().Solve();
        }
    }
    struct ModInt
    {
        const int MOD = 1000000007;
        long Data;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public ModInt(long data) { if ((Data = data % MOD) < 0) Data += MOD; }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static implicit operator long(ModInt modInt) => modInt.Data;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static implicit operator ModInt(long val) => new ModInt(val);
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator +(ModInt a, ModInt b)
        {
            long res = a.Data + b.Data;
            return new ModInt() { Data = res >= MOD ? res - MOD : res };
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator +(ModInt a, long b) => a.Data + b;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator -(ModInt a, ModInt b)
        {
            long res = a.Data - b.Data;
            return new ModInt() { Data = res < 0 ? res + MOD : res };
        }
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator -(ModInt a, long b) => a.Data - b;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator *(ModInt a, ModInt b) => new ModInt() { Data = a.Data * b.Data % MOD };
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static ModInt operator /(ModInt a, ModInt b) => a.Data * GetInverse(b);

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public override string ToString() => Data.ToString();

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        static long GetInverse(long a)
        {
            long div;
            long p = MOD;
            long x1 = 1, y1 = 0, x2 = 0, y2 = 1;
            while (true)
            {
                if (p == 1) return x2;
                div = a / p;
                x1 -= x2 * div;
                y1 -= y2 * div;
                a %= p;
                if (a == 1) return x1;
                div = p / a;
                x2 -= x1 * div;
                y2 -= y1 * div;
                p %= a;
            }
        }
    }

}


Measured memory_bytes: 30332