/*******************************************************************************************************************************************************************************************************************************************************************
********************************************************************************************************************************************************************************************************************************************************************

                                                                                                                                                                                                                                                                `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                               .:!|%|;'.                                                                                                           `
                                                                                                                                             ;&#&!'..|##&:                                                                                                         `
                                                                                                                  ...                      '$@@;  .`. `%@%:                                                                                                        `
                                                                                                                :%@#%`                    '&#%'.`''''..;%&!                                                                                                        `
                                                                                                              .%#%:|&!                  `%#|`..'''`''`.:|$!                                                                                                        `
                                                                                                             `|$|. .!|:                :%@&:.`'`. .`'`.:|&|.                                                                                                       `
                                                                                                            `|@|`...:$$'              :$#&!``':.  .`'`.;%&|.                                                                                                       `
                                                                                                           '$@$'.''``|#&;.           |##%'.':'.   .`'`.:%&%.                                                                                                       `
                                                                                                           !@%:``'''`:$#@;.         ;@#%'``'`     .`'`.'|@$.                                                                                                       `
                                                                                                          `%$:.`'''''``!&#&'   .;%&##|```''.      .`'`.'!@&'                                                                                                       `
                                                                                                          '%%'.`'''''```:$#&|%$@#@$!'..`''`       .''```;&&'                                                                                                       `
                                                                                                          :%|'.`''''''```:|@#&$;'``.``'''`        .`'```:&&:                                                                                                       `
                                                                                                         :$&|'.`'''''''''``....`''''''''`         .`''`.`%$;                                                                                                       `
                                                                                                      .'|@#%:``'''``''''''''`''''``''''`.         .`''`.`!$|`                                                                                                      `
                                                                                                     ;&##$!'``''''''''''''''''''`''''''`.         .`''`.`;$$:.                                                                                                     `
                                                                                                 '!&#@|'...'''''''''''`''''''''''''''''''::`      .`'''```!$|`                                                                                                     `
                                                                                               :&##@%'..`''''''''''''''''''''''''''''''''''''.    .''''```;&&:                                                                                                     `
                                                                                           '|@#@|'. .':'''''''''''''''''''''''''''''''``'''''''...`'''''`.'$#|`                                                                                                    `
                                                                                       .';|@#&|' .`'''``'`''''''''''''''''''''''''''''''''```'''''''''''`.`%@$;                                                                                                    `
                                                                                .`':!%$&&&$;'`.`'''''```''`..``'''''''''''''''''''''''''''''''`''''''''''``!&#$`                                                                                                   `
                                                                 ...`':;!||%$&@###&%!'.   .`:'''''``.;%$$$&&%!'``''''''''''''''''''''''''''''''''''`''''''`'!&#|.                                                                                                  `
                                                             '|$&&&@@#@@&&&&$%|;'`...```'''''''''``'!%!'`:%###@!```'''''''''''''''''''''''''''''''''''''''``'|@&|`                                                                                                 `
                                                            `|#######$'...    .``'''''''''''''''`';$&: `!$#####&!'``'''''''''''''''''''''''''''''''''''''''`.:%##%:                                                                                                `
                                                            '%###@@&|`                    .``'''`'!$&: '$@#####|'```''''''''''''''''''''''''''''''''''''''''`.`%##@%'                                                                                              `
                                                            '%#%'``.                          .`'``:||;;|@##&%;`.`'''''''''''''''''''''''''''''''''''''''''''`.;$###$`                                                                                             `
                                                            `|@!                                .':'``'''`....`''''''`.``''''''''''''''''''''''''''''''''``''''`.;$##&!.                                                                                           `
                                                            .!@|.                                 `':'``````''''''`.      .`'''''''''''''''''''''''''''''''''''``.:%@#@!`                                                                                          `
                                                             ;@%`                                   `':'''''`''''.          .''''''''''''''''''''''''''''''''''''`.`;@##|`                                                                                         `
                                                             :&&;.                                    `''::'''''`             .''''''''''''''''''''''''''''''''''''`.:$@@%'                                                                                        `
                                                             `|&&;                                       ..``'''.              .`'''''''''''''''''''''''''''''''''''`.'%@@|.                                                                                       `
                                                              `$#&;.                                                             .`''''''''''''''''''''''''''''''''''..:%@$`                                                                                       `
                                                               :@##$;.                                                             .`''''''''''''''''''''''''''''''`````;&@:                                                                                       `
                                                               `%####|`                                                               ..``'''''''''''''''''''''''''''``.:$&;.           `'::''``.                                                                  `
                                                                 `%@####@%!`                                                              .`'''''''''''''''''''''''''``.'|&%'        :%&&$$$$$&&@&&&%!:`             .``.                                          `
                                                                  .!&######@&$$%||!!!!;:'.                                                .`''''''''''''''''''''''''''`.'|&$;.     .:%$%|!!|||||||%%$&&$%!;:''::;;!!|$$!'                                          `
                                                                    `|####&;':;!|||||!:`.                                                .``'''''''''''''''''''''''''``.'!&$;.    :|$||||||||||||||||||%%%%%%%$$%%%|%$%'                                           `
                                                                      `!&##@%;`                                                     .`''''''''''''''''''''''''''''''''`.`!$&!. .;$&$%|%%%%||||||||||||||||!!!!!!!!!%$!'                                            `
                                                                        .:!&##@%:`.                                                .''''''''''''''''''''''''''''''''''`.`;$&|'`|@@@&&&&@&&&$$%%||||||||||||!!!!!!|$$|`                                             `
                                                                           `:|&##@$%!'                                            .`'''''''''''''''''''''''''''''''```'':|$@&$%$$$&@@@&&@@@@@@&$%||||||!!!!!!!!%$&$!'                                              `
                                                                               '%@####@%;.                                       .`''''''''''''''''''''''''''''````';%&@@@@@@&$|!|%&&$%|||%$&@@@&$%|||||||||%$&&%;.                                                `
                                                                                 `:|&####$;.                                     `'''''''''''''''''''''''''''```:;|$&@&$%%%&@@&%||%&&$%|||||%%$@@@&$%%$$&&@@@@$;.                                                  `
                      .:!|!'                                                         `!%&@@%;::;:'.                             .''''''''''''''''''''''''```':!$#@&$%|!||||$&@&%||%&&%||!||||||%$$&@@@&%|;:`                                                       `
                    ;$@##@@##|.                                                       '|&$$$%%%$$%%|!;:''`.                     `'''`''''''''''''''''`'''':!%$&&$%|||||||||$&@@%||%&&%||||||||||||%$&&%:.                                                          `
                  '$#@|.   .|#&:                                                       :%&$|!!!!|||%%%$$%%%|!!;'`.             .'''''''''''''''''````':!|%$&&$%%|||||||||||%&@&%||%$$%||||||||||||||%&&%:.                                                         `
                 '$#%`      .|#&'         .....                                         .|@$|!!!!!!!!!!!!|||%%$$$$$$%!:'`.      `'``````````````'':!|$&&&$%||||||||||||||||%$@#@@@@#@$%%|||||||||||||||$&&|`                                                       `
                .|@@!        :&@;                                                      `!%$&&$%|!!!!!!!!!!!!!!!||||%%$$$$%|!:''::::::::::;;;!!!!|%%$$$%|||||||||||||||||%%%$&&$%%%%%&@@$$%||||||||||||||%%$%!'.                                                    `
                `%#&:        .|##$;`.      ...                   :!%%%%%$$$%%%%$&@@@@@####@&@&$%!!!!!!!!!!!!!!!!!!!!!||%%%%$$$$$$$$$$$$$$$$$$$%%%%|||||||||||||||||%%%$$&&&|;;;;::::;%@@@&$%|||||||||||||||%%%|!;:':;;'.                                           `
                '$#|.          :$@###########################@@&@@@@@&&$$$$$$$$$%%$$&$$$&&%|%&&$||!!!!!!!!!!!!!!!!!!!!!!!!||||||||||%%%||||||||||||||||||||||||%$$&&&&&&$!:'''':!;;::';%@@&%|||||||||||||||!!||%$&@@%'                                             `
                '&#!.                   ...``````'''''''`'''';!%&&|''''''''''''''''''''''::::%&$%%|!!!!!!!!!!!!!!!!!!!!!!!!||||||||||||||||||||||||||||||||%%$&&&$$&&&%!:'``''':::::'``;%&@$%||||||||!||||||%$&@&%!'.                                              `
                .%#$'                                          ;&@|:''''''''''''''''''''''''';%$$%%|!!!!!!!!|||!!!!!!!!!!||||||||||||||||||||||||||||||%$$&@@@&$$&@&|:';!;:''''::''''''';$&&&&$$%%%%%%%$$$&@@&%'                                                   `
                '$#@|`                                         ;&@|:''''''''''''''''''''''''':!$&$%%|!!!!!!!!!!!!!!!!!!!!!!||||||||||||||||||||||||%%$$&&&&&&&&&&$|;::::::::'''''''''''`';%&@&&&&&&&$&&@&&&@#&:                                                    `
             `';;%@#@%`                                        ;&@|:'''''''''''''''''''''''''':%@&$$%|!!!!!!!!!!!!!!!!|||||||||||||||||||||||||%%$$&&&&$$$$&&$$|;:'``''''''::''''''''''``.';!!!!!!;;:;:'`.`!&@|`                                                   `
            `:;;;:;!$@#@%;`                                    :&@|:'''''''''''''''''''''''''``;%&&$$%|!!!!!!!!!!!!!!!|||%%%$$$$$$$$%%%%%%$$$&&&&&&$$%%$&@&%%@#$!!;:`'''''''''''''''''''''`''''''''''''':!$@##&`                                                   `
            .':;;;;:::!%&###@&|'                              .!@@|:''''''''''''''''''''''''''`';%&&&$%||!!!!!!!!!!!!!!!!||||%%%$$$$$$$$$$&&$$$$%%||%&&&$%%%$@#@$%&&@#$!:''''''''''''::::'::::::::::!$@#####@;                                                     `
            .`::;;;;;:::::;!%$@##@@%;.                         ;@@|'''''''''''''''''''''''''''''';%&@&$$%||!!!!!!!!!!!!!!!!!!||||||||%%%%%%%%||||%$&&$$$$$$$$@#@%!;%@@@#@&|:'''''::::'''':::::;!%&@###&|;|&#$`                                                     `
            .'::;;;;;;;:::::::::;|&@###@$|:`                   :&@|:''''''''''''''''''''''''::':;%@@@@@&$$%|!!!!|!!!!!!||!!||||||||||||||||||||%&&&&$$$$$$$%$@#@%!;!$#####@#&!''::''''':;|&@######&;.     !#$`                                                     `
            .'::;;;;;;::::::::::`     '!$@####@&%;`.           ;&@%:''''''''''''''''''''''''''':!%$$$&&&&&$%%||!!!!!!!!|||||||!|||||||||||||||%&@&$&&$$$$$$%$@#@|;;|$@@; `|&##@&|::;|$&@####$;`          `|@%`                                                     `
            .'::;;;;;;:::::::::::'`.         `'!$@###@@&%;`   .!@#$;'''''''''''''''''''''''':'';%&@&$$$&&&&&$$%%|!!!!||!!!|||||||||||||||||||$@&&&$$$$$$$$$%$@#&!::!%@@|.     :&#######@%;.              `$@!                                                      `
            .':::;;;:;;;:::::::::'``...             `!$@@####@@@@#$:'''''''''''''''''''''''':'';%@@$$$$$$$$&&&&$%%|||!!||||||||||||||||||||$&&&&#@$$$$$$$$%$&##$!:';%&#%.       '$@@|.  .                |#$`                                                      `
            `':::;;;;;::::::::::''```..  ...              .'!|&###%:'''''''''''''''''''''''''''!&#@$$$$$$%%&@@&@@&$%%|||!|||||||||||||||||%&&%!$#@$$$$$$$$%$&##$!:';%@@;         !@&:                   ;@&;                                                       `
            `':::;::;;;:::::::''''``....                       !@#%:'''''''''''''''''''''''''''!&@&$$$$$$$$@&|:!%&&@&$%%|||||||||||||||||$&$!``%#&$$$$$$$$$$&##$!:':|@@;        ;@@;                   !@&;                                                        `
            `':::;;;;;::::::::'''```.. .                       `$#&;'''''''''''''''''''''''''''|@#&$$$$$$$&@$;''':;|$&&$$%%||||||||||||%&@$;'';$#&$$$$$$$$$$&##$;'':|@@;       !@@;                  '&#&:                                                         `
            `''::::::::::::::''''``...                          `$#@&%|;::::::::::::::::'''''':%##&$$$$$$$$@&;'':''':!$&&&$$%||||||%%$&&%;'''';&#&$$$$%$$$$$@##$;:':|@&:      !@@;                  ;@#$'                                                          `
            `''::::::::::::::''''``...                            :$##@@@@@@@@&&&&&&&@&&$%|!;:;$##&$$$$$$$$&|'':::''''';%&&$$$$%%%$&&%!:''''''!&#&$$$$$$$$$$&##%;:':|@&'    `$#$`                 .|#@!                                                            `
            .`''::::::::::::''''````..                               .....';|%$&@@@@@@@####@$|!&#@$$$$$$$$$&!''::''''''':|$&&$$&@&$!;:'''''''';$#&$$$$$$$$$%&##%:'':%@@:   :&@;                  ;&#$`                                                             `
            .``'':::::::::''''''```...                                                 '%###$|!&#@$$$$$$$$$$!''::''''''''`'|&@#$;'`''''''''''';$#@$%%$$$$$$$&#@|:'':%@&'  !@&:                `|@#|.                                                               `
            .``'''::::::::'''''```...                                                   :&#@$||@#&$$$$$$$$&&!''''''''''''''':;;''''''''''''''';$#@$$%$$$$$$$&#@|:':;%@#$%&#%.               `%@#$'                                                                 `
            ..``'''''::::''''''``....                                                   '$#@%%%@#&$$$$$$$$&&|'':'''''''''''''''''''''''''''''':%#@$$%%$$$$$$&#@|;!|$@####&:               `%@#&:                                                                   `
            ..```''''''''''''````...                                                    `%#&%%$@#&$$$$$$$$&@|'':'''''''''''''''''''''''''''''':%#@$$%%$$$$$$@#@$$&##@!.                 .|@#@!                                                                     `
             ..```''''''''``````...                                                     `%#&||$##&$$$$$$$$&&|:'''''''''''''''''''''''''''''''':$#@$$%%$$$$%$@##@##&:                  .|@#@;                                                                       `
             ...``````````````...                                                       `$@&|%&##&$$$$$$$$&@|''''''''''''''''''''''''''''''''';$#@$$$$%$$%%&####&;                  .|@#$'                                                                         `
              ....`````````.....                                                        '$@$|$&##&$$$$$$$$&@|''''''''''''''''''''''''''''''''';&#@$$$$%$$$$$&##@!                 .|@#$`                                                                           `
                ...............                                                         ;&@$|$@#@$$$$$$$$$&@%:'''''''''''''''''''''''''''''''';&#@$$$$$$$$$$&##&:        `      .|@#|.                                                                             `
                   .......                                                              !@@%|&##@$$$$$$$$$@@|''''''''''''''''''''''''''''''''';&#&$%%$$$$$$$&##@!.        .```.`:$@#%.                                                                             `
                                                                                       .|#&%|&##&$$$$$$$$$@&;''''''''''''''''''''''''''''''''':$#&$%%$$$$$$%&##@;               `|@@|                                                                              `
                                                                                       '$#&||&##&$$$$$$$$&@$:''''''''''''''''''''''''''''''''':%@&$%%$$$$$$%&###&;           ...`!@#%.                                                                             `
                                                                                       ;&@$!|&##&$$$$$$$$&#$:''''''''''''''''''''''''''''''''':$#&$$$$$$$$%$&#####$:             ;@#&`                                                                             `
                                                                                       !@@%;|&#@$$$$$$$$$&#$:''''''''''''''''''''''''''''''''':$#&$$$$$$$$$$@##&%%@######@$||$&@##$'                                                                               `
                                                                                       !@@|;|&#&$$$$$$$$$&#$:''''''''''''''''''''''''''''''''':%#@$$$$%$$$$$@#@|:'':;%@&&&@@@&%!'                                                                                  `
                                                                                       !@@!:|@#&$$$$$$$$$@#%:''''''''''''''''''''''''''''''''''|@@$$$$$$$$$$@#@!:''``|@;                                                                                           `
                                                                                       !&%::|&#@$$$$%$$$$@#|'''''''''''''''''''''''''''''''''':%##$$$$$$$$$&@#@|:::``%@!                                                                                           `
                                                                                       `''``:!|%$%|!!!!!||%|;''`..````.````````````````''''''';|%%||!!;;!!|%%%|:`   .%@!                                                                                           `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                    .                                                                             .`.                                                                                              `
                                                         ......:!:. ...           `|$'         `%|'!%!;|%$$$$$$:    `|$%%$$$$$$%$$%'   :$%%%%%%$$$%%$$%$|.        :$$;;;;;'                         .!%`   .........                                               `
                                                        ':;!!!|$%!!!!!;'.  `|%|!!!|%$%!!!!|!.  .:$@$;.    '%$;`     '%|'`.`%@;.`'%&:    .     `|%:     ..    ````';&$:':::'`.                        ;|`  :%$&&$%%&@!                                              `
                                                          .;!::;;:':|!.    '&$;::'. `;!'..;|`  ;%%%!;;|%%%$&%%%|;`  '%%;:':$@!':;$&:         `||'.          '$$;:;|$%;;!!:!%;.                      .;|'``. .!!.  :&!                                              `
                                                          `%@&&&&&&&@$`      ..'!%%:`;;`       ..`;$%`  .`!!`       `|!'``'%&;``'%&:       `;|&%`:%%;.      `$&|%$&@&|;;:`'`                      `%&&$!;;` .%%. `;%:                                              `
                                                          `||::''':;%%`      :%!'`` `!:         .;&#$` `:$&;...      ':'::|%!:::::'.     .:%|':|`  :|!'     '%%. .'!|:'';|!.  .!$%%%%%%%%%%%%%%!`    ;!.    `$%. `;!'                                              `
                                                          `%@&&&&&&&@%`    `;;;!!;'`:%!'`'':'  ;&%;$$;%|!$&%%!!!.  .:%$%%$&@&$%%%$%!'  :%$%'  '!'   .|&|'  .:|!.  `||:!!'.                           :!..;:`;$!  `;!'                                              `
                                                       `::;|!;:::::;|%;:;` .`''''':%&|;:'''``  ''.`%$!$!`$%!&;'!`    .. `;%!. ...;%!'  `'.    '!'     .    '!!;!|''$|'!;':!;.                       .|&$|!:|$;.  `;!'                                              `
                                                        .``;%%!'.'!%$!:`.      `:!||:'!%%!:.     '|%|!&|:$$|&!;|:     .'!$%`     !&;.         '!'          !&:.:|:'&|'!;:;;`                        .;;``:||:  .:%$;`                                              `
                                                       .:$&!'.     .`!@%'  '$@@$!'.     `!$%'  '$#&;'|%%|%%%%||%|' ;$&&%!`    .%@&%'          :|'         '%%`'&#@@##@@@@@@#$`                         `|@%.  .%@$;.                                               `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
                                                                                                                                                                                                                                                                   `
********************************************************************************************************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************************************************************************************************/
//********************
//*@Author:  ChenShou*
//*@Language:C++11   *
//********************

#include<bits/stdc++.h>

//#pragma comment ( linker ," /STACK:102400000 , 102400000 " )
//#define DEBUG
#define RI register int
#define endl "\n"

using namespace std ;

typedef long long ll ;
// typedef __int128 lll ;
const int MOD = 1e9 + 7 ;
const double PI = acos(-1.0) ;
const double EXP = 1E-9 ;
const int INF = 0x3f3f3f3f;

inline ll read(){
    long long x = 0 , f = 1 ;
    char ch = getchar() ;
    while(ch<'0'||ch>'9'){
        if(ch == '-') f = -1 ;
        ch = getchar();
    }
    while(ch >='0' && ch <= '9' ){
        x = (x<<1) + (x<<3) + (ch^48);
        ch = getchar();
    }
    return x*f ;
}

struct mas{
    int c;
    int a[15];
};

mas sum={0};
ll N,M,X,min_c=INF;
mas mass[15];

void dfs(int n,mas tmp){
    if(n==N)return ;
    bool flag=true;

    dfs(n+1,tmp);

    tmp.c+=mass[n].c;
    for(int i=0;i<M;i++){
        tmp.a[i]+=mass[n].a[i];
        if(tmp.a[i]<X){
            flag=false;
        }
    }
    if(flag&&tmp.c<min_c)min_c=tmp.c;
    dfs(n+1,tmp);


    return ;
}

void solve(){
	N=read(),M=read(),X=read();
	for(int i=0;i<N;i++){
        mass[i].c=read();
        for(int j=0;j<M;j++){
            mass[i].a[j]=read();
        }
	}
	dfs(0,sum);
	if(min_c!=INF)cout<<min_c<<endl;
	else cout<<-1<<endl;
	return ;
}

int main(){
#ifdef DEBUG
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
#endif
//	for(ll T=read();T;T--)
		solve();
#ifdef DEBUG
    printf("\nHellow , Mr.ChenShou\n");
    printf("\t Time cost : %lf s \n",(double)clock()/CLOCKS_PER_SEC);
#endif
    return 0;
}


Measured memory_bytes: 3628