#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>

using namespace std;

void solve(int n, int d, int x) {
	vector<vector<int>> prices(n, vector<int>(d, 0));

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

	vector<int> dp(100010, -1);

	for (int i = 0; i < d - 1; i++) {
		for (int j = 0; j <= x; j++) {
			dp[j] = j;
		}
		for (int j = 0; j < n; j++) {
			for (int k = 0; k <= x; k++) {
				if (k >= prices[j][i]) {
					int prev = dp[k];
					int next = dp[k - prices[j][i]] + prices[j][i + 1];
					dp[k] = max(prev, next);
				}
			}
		}
		int y = 0;
		for (int j = 0; j <= x; j++) {
			y = max(y, dp[j]);
		}
		x = y;
	}

	cout << x << endl;
}

int main() {
	int n, d, x;
	cin >> n >> d >> x;
	solve(n, d, x);
}