#include<iostream>
#include<vector>
#include<cassert>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main(){
  int n,d,x;
  cin >> n >> d >> x;
  vector<int> p(n);
  rep(i,n)cin >> p[i];

  rep(azu,d-1){
    vector<int> q(n);
    rep(i,n)cin >> q[i];
    vector<int> dp(x+1,0);
    
    rep(i,n){
      rep(j,x-p[i]+1){
	dp[j+p[i]] = max(dp[j+p[i]], dp[j]+q[i]);
      }
    }

    int maxv = x;
    rep(i,x+1)maxv = max(maxv, dp[i]+x-i);
    x = maxv;
    p = q;
  }
  cout << x << endl;
}