#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;

ll n,d,x;

vector<vector<ll>> P;

ll ans(ll k,ll day){
    vector<ll> dp(k+1,0);
    dp[0]=k;
    for(int i=0;i<n;i++){
        for(int t=0;t+P[day][i]<=k;t++){
            dp[t+P[day][i]]=max(dp[t+P[day][i]],dp[t]+P[day+1][i]-P[day][i]);
        }
    }
    ll ret=0;
    for(int i=0;i<=k;i++){
        ret=max(ret,dp[i]);
    }
    return ret;
}


int main(){
    cin>>n>>d>>x;
    P.resize(d,vector<ll>(n));
    for(auto &i:P){
        for(auto &t:i){
            cin>>t;
        }
    }
    for(int i=0;i+1<d;i++){
        x=ans(x,i);
    }
    cout<<x<<endl;
    
    
    return 0;
}

