using System;
using System.Collections.Generic;
using System.Linq;
public class AtCoder
{
    public static void Main()
    {
        //入力を保持する
        var NMX = Console.ReadLine().Split().Select(v => int.Parse(v)).ToArray();
        //本の種類N
        var N = NMX[0];
        //アルゴリズムの種類M
        var M = NMX[1];
        //目標経験値
        var X = NMX[2];
        //経験値群の二次元配列
        var exs = new int[N, M + 1];
        //書籍の値段リスト
        var prices = new int[N];
        var index = new int[N];

        for (int n = 0; n < N; n++)
        {
            var ex = Console.ReadLine().Split().Select(v => int.Parse(v)).ToArray();
            prices[n] = ex[0];
            index[n] = n;
            for (int m = 1; m < M + 1; m++)
            {
                exs[n, m - 1] = ex[m];
            }
        }

        var ans = int.MaxValue;
        for (int cnt = 1; cnt < N + 1; cnt++)
        {
            foreach (var cases in CasesReturn<int>(index, cnt))
            {
                var contFlg = true;
                for (var m = 0; m < M; m++)
                {
                    var check = 0;
                    foreach (var c in cases)
                    {
                        check = check + exs[c, m];
                    }
                    //Console.WriteLine(check);
                    if (check < X)
                    {
                        contFlg = false;
                        break;
                    }
                }
                if (contFlg)
                {
                    //Console.WriteLine("Yes");
                    var priceCheck = 0;
                    foreach (var c in cases)
                    {
                        priceCheck = priceCheck + prices[c];
                    }
                    //Console.WriteLine(ans);
                    //Console.WriteLine(priceCheck);
                    if (priceCheck < ans)
                    {
                        //Console.WriteLine("Yes");
                        ans = priceCheck;
                    }
                }
            }
        }
        if (ans == int.MaxValue)
        {
            Console.WriteLine("-1");
        }
        else
        {
            Console.WriteLine(ans);
        }
    }
    public static IEnumerable<T[]> CasesReturn<T>(IEnumerable<T> prices, int cnt)
    {
        if (cnt == 1)
        {
            foreach (var p in prices)
            {
                yield return new T[] { p };
            }
            yield break;
        }
        else
        {
            foreach (var p in prices)
            {
                var left = new T[] { p };

                //Console.WriteLine("left : " + p);
                //pより前にある要素をすべてスキップして要素pもスキップする
                var used = prices.SkipWhile(e => !e.Equals(p)).Skip(1).ToArray();

                //var strUs = "used : ";
                //foreach(var u in used)
                //{
                //    strUs = strUs + u;
                //}
                //Console.WriteLine(strUs);

                foreach (var cases in CasesReturn(used, cnt - 1))
                {
                    yield return left.Concat(cases).ToArray();
                }
            }
        }
    }
}


Measured memory_bytes: 41384