import math import queue class Node: def __init__(self): self.edges_to=[] self.edges_cost=[] self.edges_minute=[] n=int(input()) c=int(input()) v=int(input()) s=[int(i) for i in input().split()] t=[int(i) for i in input().split()] y=[int(i) for i in input().split()] m=[int(i) for i in input().split()] nodes=[Node() for i in range(n)] for i in range(len(s)): nodes[s[i]-1].edges_to.append(t[i]-1) nodes[s[i]-1].edges_cost.append(y[i]) nodes[s[i]-1].edges_minute.append(m[i]) dp=[[-1 for i in range(c+1)] for j in range(n+1)] def fun(index,cost): if dp[index][cost] != -1: return dp[index][cost] if cost<0: return math.inf if index==n-1: return 0 mini=math.inf for to in range(len(nodes[index].edges_to)): mini=min(fun(nodes[index].edges_to[to],cost-nodes[index].edges_cost[to])+nodes[index].edges_minute[to],mini) dp[index][cost]=mini return mini sum=fun(0,c) print(-1 if sum==math.inf else sum)