#include <iostream>
#include <algorithm>
#define MAX_P 100001
using namespace std;

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

    int dp[MAX_P];
    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 + 1; k++) {
                if (k >= p[i][j]) {
                    dp[k] = max(dp[k], dp[k - p[i][j]] + p[i + 1][j]);
                }
            }
        }

/*
        for (int j = 0; j < x; j++) {
            cout << dp[j] << " ";
        }
        cout << endl;
*/
        int res = dp[0];
        for (int j = 1; j <= x; j++) {
            res = max(res, dp[j]);
        }
        x = res;
    }

    cout << x << endl;
    return 0;
}