#include using i64 = std::int64_t; using vi64 = std::vector; using vvi64 = std::vector; int main() { using namespace std; const i64 inf = 1e9; i64 n, c, v; cin >> n >> c >> v; vi64 s(v); for (i64 i = 0; i < v; i++) { cin >> s[i]; s[i]--; } vvi64 t(n), y(n), m(n); i64 x; for (i64 i = 0; i < v; i++) { cin >> x; x--; t[s[i]].push_back(x); } for (i64 i = 0; i < v; i++) { cin >> x; y[s[i]].push_back(x); } for (i64 i = 0; i < v; i++) { cin >> x; m[s[i]].push_back(x); } vvi64 dp(n, vi64(c + 1, inf)); dp[0][c] = 0; for (i64 i = 0; i < n; i++) { for (i64 j = 0; j < (c + 1); j++) { if (dp[i][j] == inf) continue; for (i64 k = 0; k < t[i].size(); k++) { i64 to = t[i][k], cost = j - y[i][k]; if (cost >= 0) { dp[to][cost] = min(dp[to][cost], dp[i][j] + m[i][k]); } } } } i64 ans = inf; for (i64 i = 0; i < (c + 1); i++) ans = min(ans, dp[n - 1][i]); if (ans == inf) cout << "-1\n"; else cout << ans << '\n'; }