using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;


class Program
{
    static int n;
    static List<string> list;
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        //var n = int.Parse(Console.ReadLine());
        int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        n = input[0];
        var m = input[1];
        var x = input[2];

        int[][] jag = new int[n][];
        for (int i = 0; i < jag.Length; i++)
        {
            jag[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
        }

        var money = 0;
        var ans = int.MaxValue;
        var ok = true; ;
        for (int s = 0; s < n; s++)
        {

            int nn = n;
            int kk = s + 1;
            var nums = Enumerable.Range(1, nn).ToArray();
            var combinations = Combination.Enumerate(nums, kk, withRepetition: false);

            foreach (var item in combinations)
            {
                int[] sum = new int[m];
                money = 0;
                ok = true;
                for (int t = 0; t < item.Length; t++)
                {

                    switch (item[t])
                    {
                        case 1:
                            money += jag[0][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[0][i + 1];
                            }
                            break;
                        case 2:
                            money += jag[1][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[1][i + 1];
                            }
                            break;
                        case 3:
                            money += jag[2][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[2][i + 1];
                            }
                            break;
                        case 4:
                            money += jag[3][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[3][i + 1];
                            }
                            break;
                        case 5:
                            money += jag[4][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[4][i + 1];
                            }
                            break;
                        case 6:
                            money += jag[5][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[5][i + 1];
                            }
                            break;
                        case 7:
                            money += jag[6][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[6][i + 1];
                            }
                            break;
                        case 8:
                            money += jag[7][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[7][i + 1];
                            }
                            break;
                        case 9:
                            money += jag[8][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[8][i + 1];
                            }
                            break;
                        case 10:
                            money += jag[9][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[9][i + 1];
                            }
                            break;
                        case 11:
                            money += jag[10][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[10][i + 1];
                            }
                            break;
                        case 12:
                            money += jag[11][0];
                            for (int i = 0; i < m; i++)
                            {
                                sum[i] += jag[11][i + 1];
                            }
                            break;
                    }

                }
                for (int k = 0; k < sum.Length; k++)
                {
                    if (sum[k] < x)
                    {
                        ok = false;
                        break;
                    }
                }

                if (ok)
                {
                    ans = Math.Min(ans, money);
                }
            }
        }

        if (ans == int.MaxValue) ans = -1;
        // 出力
        Console.WriteLine(ans);
    }

    public static class Combination
    {
        public static IEnumerable<T[]> Enumerate<T>(IEnumerable<T> items, int k, bool withRepetition)
        {
            if (k == 1)
            {
                foreach (var item in items)
                    yield return new T[] { item };
                yield break;
            }
            foreach (var item in items)
            {
                var leftside = new T[] { item };

                // item よりも前のものを除く （順列と組み合わせの違い)
                // 重複を許さないので、unusedから item そのものも取り除く
                var unused = withRepetition ? items : items.SkipWhile(e => !e.Equals(item)).Skip(1).ToList();

                foreach (var rightside in Enumerate(unused, k - 1, withRepetition))
                {
                    yield return leftside.Concat(rightside).ToArray();
                }
            }
        }
    }
}

Measured memory_bytes: 41244