const ll INF=1d18,Z=3001; struct Edge{ ll to,d; }; ll N,Q,C; vectorE[Z]; ll X[Z],D[Z][Z],P[Z][Z],T[Z],B[Z]; vector I[Z]; { rd(N,Q,C); rep(i,N-1){ ll u,v,d; rd(u--,v--,d); E[u].push_back({v,d}); E[v].push_back({u,d}); } rd(X(Q)--); D[0..N][0...N]=P[0..N][0...N]=-1; rep(s,N){ auto& Q=I[s]; D[s][s]=0; Q.push_back(s); rep(i,Q.size()){ ll p=Q[i]; for(Edge e:E[p]) if(D[s][e.to]==-1){ D[s][e.to]=D[s][p]+e.d; P[s][e.to]=p; Q.push_back(e.to); } } } T[0..N]=INF; T[X[0]]=0; rep(i,Q-1){ ll s=X[i],t=X[i+1]; B[0..N]=T[0..N]+C; B[s]=T[s]; for(ll p:I[s]) for(Edge e:E[p]) B[e.to]