#!/usr/bin/env python3 from collections import defaultdict def memoize(f): table = {} def func(*args): if not args in table: table[args] = f(*args) return table[args] return func N = int(input()) C = int(input()) V = int(input()) S = [int(x) for x in input().split()] T = [int(x) for x in input().split()] Y = [int(x) for x in input().split()] M = [int(x) for x in input().split()] e = defaultdict(list) for s, t, y, m in zip(S, T, Y, M): e[t].append((s, y, m)) @memoize def path(now): if now == 1: return {0: 0} tmp = defaultdict(list) for s, y, m in e[now]: for cost, time in path(s).items(): cost += y time += m if cost <= C: tmp[cost].append(time) ret = {} for cost, times in tmp.items(): ret[cost] = min(times) return ret walks = path(N).values() if len(walks) == 0: print(-1) else: print(min(walks))