#include <bits/stdc++.h>

using namespace std;

struct Item {
	int value, weight;
};

int dp[11][100001];
int knapsack(vector<Item>& items, int W) {
	fill(dp[0], dp[11], -1); dp[0][0] = 0;
	int N = items.size();
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j <= W; ++j) {
			if (dp[i][j] < 0) continue;
			int nj = j+items[i].weight;
			if (nj <= W) {
				dp[i][nj] = max(dp[i][nj], dp[i][j]+items[i].value);
			}
			dp[i+1][j] = max(dp[i+1][j], dp[i][j]);
		}
	}
	int res = 0;
	for (int i = 0; i <= W; ++i) {
		res = max(res, dp[N][i]);
	}
	return res;
}

int main() {
	int N, D, X; cin >> N >> D >> X;
	vector< vector<int> > P(D, vector<int>(N));
	for (int i = 0; i < D; ++i) {
		for (int j = 0; j < N; ++j) {
			cin >> P[i][j];
		}
	}
	vector< vector<Item> > items(D-1, vector<Item>(N));
	for (int i = 0; i < D-1; ++i) {
		for (int j = 0; j < N; ++j) {
			items[i][j] = (Item){P[i+1][j]-P[i][j], P[i][j]};
		}
	}
	for (int i = 0; i < items.size(); ++i) {
		X += knapsack(items[i], X);
	}
	cout << X << endl;
}