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

int knapsack(vector<int> &v,vector<int> &w,int W){
	int n=v.size();
	vector<vector<int> > val(W+1,vector<int>(n+1,0) );
	for(int i=0;i<n;i++){
		for(int j=1;j<=W;j++){
			if(j>=w[i]){
				val[j][i+1] = max(val[j][i],val[j-w[i]][i+1]+v[i]);
			}else{
				val[j][i+1] = val[j][i];
			}
		}
	}
	return val[W][n];
}

int main(){
	int n,d,x;
	cin>>n>>d>>x;
	vector<vector<int> > p(d,vector<int>(n,0) );
	for(int i=0;i<d;i++)
		for(int j=0;j<n;j++)
			cin>>p[i][j];
	for(int i=0;i<d-1;i++){
		vector<int> v(n);
		vector<int> w(n);
		for(int j=0;j<n;j++){
		       	v[j] = p[i+1][j]-p[i][j];
			w[j] = p[i][j];
		}
		 x = x + knapsack(v,w,x);

	}
	cout<<x<<endl;


	return 0;
}

