from heapq import * inf = float("inf") N, M = map(int, input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b, c = map(int, input().split()) a -= 1 b -= 1 G[a].append((b,c)) G[b].append((a,c)) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) dist = [inf] * N dist[0] = 0 hq = [] heappush(hq,(dist[0],0)) while hq: d, x = heappop(hq) if dist[x] != d: continue if d == 0: k = 1 else: k = (d + A[x] - 1) // A[x] ad = A[x] * k - d if k % B[x] == 0: ad = min(ad + C[x], A[x] * (k+1) -d) for nx, c in G[x]: nd = dist[x] + ad + c if dist[nx] > nd: dist[nx] = nd heappush(hq,(dist[nx],nx)) print(dist[N-1])