#include<iostream>
#include<algorithm>
using namespace std;

int main() {
	int i, j, k, n, d, x, maxx, p[11][11], curp, nextp;

	cin >> n >> d >> x;
	for (i = 0; i < d; i++) {
		for (j = 0; j < n; j++) {
			cin >> p[i][j];
		}
	}

	for (i = 0; i < d - 1; i++) {
		int dp[100000] = {};
		for (j = 0; j < n; j++) {
			if (1.0 * p[i + 1][j] / p[i][j] <= 1.0)continue;
			curp = p[i][j];
			nextp = p[i + 1][j];
			k = 0;
			while (k + curp <= x) {
				dp[k + curp] = max(dp[k + curp], dp[k] + nextp);
				k++;
			}
		}
		maxx = x;
		for (k = 0; k <= x; k++) {
			maxx = max(maxx, dp[k] + x - k);
		}
		x = maxx;
	}

	cout << x << endl;

	return 0;
}