#include <bits/stdc++.h>
using namespace std;

int N, D, X;
int dp[11][100100];

int knapsak(vector<int> w, vector<int> v, int W){
    memset(dp, 0, sizeof(dp));
    
    for(int i=0; i<N; i++){
        for(int j=0; j<=W; j++){
            if(j < w[i]){
                dp[i+1][j] = dp[i][j];
            }else{
                dp[i+1][j] = max(dp[i][j], dp[i+1][j-w[i]] + v[i]);
            }
        }
    }
    return dp[N][W] + W;
}

int main (){
    cin >> N >> D >> X;
    vector<vector<int>> P(D, vector<int>(N));
    for(auto &p: P) for(auto &v: p)
        cin >> v;
    
    for(int i=0; i<D-1; i++){
        vector<int> w(N), v(N);
        for(int j=0; j<N; j++){
            w[j] = P[i][j];
            v[j] = P[i+1][j] - P[i][j];
        }
        X = knapsak(w, v, X);
    }
    
    cout << X << endl;
    
    return 0;
}