#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define ll long long
#define fst \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define f(x, y, z) for (register ll x = ((o_f_o || z >= y) ? (y) : ((cerr << "从" << y << "到" << z << "的循环为倒序" << endl), (y))); (o_f_o || z >= y) ? (x <= (z)) : (x >= (z)); x += ((o_f_o || z >= y) ? 1 : -1))
ll read_tmp = INT_MAX, o_f_o = 0;
inline ll read(ll &k = read_tmp);
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f, N = 110, K = 7;
ll n, k, p;
struct node
{
ll v = 0;
ll a[K] = {0};
bool operator<(const node &x) const
{
if (v != x.v)
return v < x.v;
f(i, 1, k)
{
if (a[i] != x.a[i])
return a[i] < x.a[i];
}
return 0;
}
node operator+(const node &x)
{
node ret;
ret.v = v + x.v;
f(i, 1, k)
{
ret.a[i] = a[i] + x.a[i];
}
return ret;
}
friend istream &operator>>(istream &in, node &x)
{
in >> x.v;
f(i, 1, k)
in >>
x.a[i];
return in;
}
} a[N];
ll ans = INF;
set<pair<ll, node>> jz;
void dfs(ll x, node y)
{
if (jz.count(make_pair(x, y)) == 1)
exit(1);
jz.insert(make_pair(x, y));
bool ok = 1;
f(i, 1, k)
{
if (y.a[i] < p)
ok = 0;
}
if (ok)
ans = min(ans, y.v);
if (x > n)
return;
dfs(x + 1, y);
dfs(x + 1, y + a[x]);
}
signed main()
{
fst;
cin >> n >> k >> p;
f(i, 1, n)
{
cin >> a[i];
}
node begin;
dfs(1, begin);
if (ans == INF)
puts("-1");
else
cout << ans << endl;
return 0;
}
inline ll read(ll&k){ll 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*10+ch-48;ch=getchar();}if(k!=INT_MAX)return k=x*f;return x*f;}