#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int N, D, X;
int dp[16][100005];
int p[16][16];

int main()
{
  cin >> N >> D >> X;
  rep(i, D) rep(j, N) cin >> p[i][j];

  for(int d=0;d<D-1;d++){
    memset(dp, 0, sizeof(dp));
    for(int i=0;i<N;i++){
      for(int j=0;j<=X;j++){
	if(j < p[d][i])
	  dp[i+1][j] = dp[i][j];
	else
	  dp[i+1][j] = max(dp[i][j], dp[i+1][j-p[d][i]] + p[d+1][i]);
      }
    }

    //    rep(i, N) rep(j, X+1) cout << dp[i+1][j] << " "; cout  << endl;
    int x = 0;
    rep(i, X+1) x = max(x, dp[N][i] + (X-i));
    X = x;
    //    cout << X << endl;    
  }
  cout << X << endl;
  return 0;
}