using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Solve.Answer();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var nmx = IO.ReadSplitInt;
            int[][] ca = new int[nmx[0]][];
            for (int i = 0; i < nmx[0]; i++)
            {
                ca[i] = IO.ReadSplitInt.ToArray();
            }

            int ans = 100100100;
            for (int bit = 0; bit < (1 << nmx[0]); bit++)
            {
                var jyoutai = new int[nmx[0]];
                for (int i = 0; i < nmx[0]; i++)
                {
                    var tmp = (bit >> i) & 1;
                    jyoutai[i] = tmp;
                }
                int cost = 0;
                int[] skill = new int[nmx[1]];
                for (int i = 0; i < nmx[0]; i++)
                {
                    if (jyoutai[i] == 1)
                    {
                        cost += ca[i][0];
                        for (int j = 0; j < nmx[1]; j++)
                        {
                            skill[j] += ca[i][j + 1];
                        }
                    }
                }
                bool f = true;
                for (int i = 0; i < nmx[1]; i++)
                {
                    if (skill[i] < nmx[2]) f = false;
                }
                if (f) ans = Min(ans, cost);
            }
            if (ans == 100100100) ans = -1;
            WriteLine(ans);
        }

        public class IO
        {
            #region Input
            public static string ReadString => ReadLine();
            public static int ReadInt => int.Parse(ReadLine());
            public static long ReadLong => long.Parse(ReadLine());
            public static double ReadDouble => double.Parse(ReadLine());

            public static List<string> ReadSplitString => ReadLine().Split().ToList();
            public static List<int> ReadSplitInt => ReadLine().Split().Select(s => int.Parse(s)).ToList();
            public static List<long> ReadSplitLong => ReadLine().Split().Select(s => long.Parse(s)).ToList();
            public static List<double> ReadSplitdouble => ReadLine().Split().Select(s => double.Parse(s)).ToList();
            #endregion

            #region Output
            public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
            public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");

            #endregion
        }

        public class Mod
        {
            #region
            private readonly static long M = 1000000007;

            public static long Add(long a, long b) => (a * b) % M;
            public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
            public static long Multi(long a, long b) => (a * b) % M;
            #endregion
        }

        public static long GCD(long x, long y)
        {
            #region
            if (x < y)
            {
                var tmp = x;
                x = y;
                y = tmp;
            }
            while (true)

            {
                if (x % y == 0)
                {
                    return y;
                }
                else
                {
                    var tmp = x;
                    x = y;
                    y = tmp % y;
                }
            }
            #endregion
        }

        public static long Choice2(long n)
        {
            #region
            if (n <= 1)
                return 0;
            if (n == 2)
                return 1;
            else
                return n * (n - 1) / 2;
            #endregion
        }
    }
}

Measured memory_bytes: 28824