n=int(input()) c=int(input()) v=int(input()) s=list(map(int,input().split())) t=list(map(int,input().split())) y=list(map(int,input().split())) m=list(map(int,input().split())) r=[[] for i in range(n)] for i in range(v): r[s[i]-1].append((t[i]-1,y[i],m[i])) table=[[-1 for j in range(c+1)] for i in range(n)] table[0][0]=0 for i in range(n): for j in r[i]: for k in range(c+1): if table[i][k]!=-1: try: table[j[0]][k+j[1]]=table[i][k]+j[2] except: pass if max(table[n-1])==-1: print(-1) else: minm=1000000 for i in range(c+1): if (minm>table[n-1][i])&(table[n-1][i]!=-1): minm=table[n-1][i] print(minm)