#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;
using db = long double;
unordered_set<int> res;
vector<vector<pii>> graph(5001);
vector<ll> ti;
int n,m,k;
const int po = 1<<5;
struct State{
ll cur,w,tickets;
//vector<ll> path;
bool operator<(const State& o) const{
return tie(w,tickets,cur)>tie(o.w,o.tickets,o.cur);
}
};
ll dijkstra(int st){
vector<vector<ll>> dis(po,vector<ll>(n+1,4e18));
vector<vector<bool>> vis(po,vector<bool>(n+1,0));
dis[0][st]=0;
priority_queue<State> pq;
pq.push({st,0,0});
while (!pq.empty()){
State t=pq.top();pq.pop();
ll cur=t.cur,w=t.w;
ll tickets=t.tickets;
//cout << cur << " " << w << " " << tickets << "\n";
if (vis[tickets][cur]) continue;
if (w > dis[tickets][cur]) continue;
vis[tickets][cur]=1;
for (pii i:graph[cur]){
ll nx=i.first,nw=i.second;
for (int j=-1;j<5;j++){
if (j==-1){
if (vis[tickets][nx]) continue;
if (dis[tickets][nx] < nw+w) continue;
//vis[tickets][nx]=1;
dis[tickets][nx]=nw+w;
pq.push({nx,dis[tickets][nx],tickets});
}
else if (ti[j]!=-1 && !(tickets>>j)&1){
int ert=tickets|(1<<j);
if (vis[ert][nx]) continue;
if (dis[ert][nx] < (nw/10*(10-j-1))+w+ti[j]) continue;
//vis[ert][nx]=1;
dis[ert][nx]=(nw/10*(10-j-1))+w+ti[j];
pq.push({nx,dis[ert][nx],ert});
}
}
}
}
ll mn=4e18;
for (int i:res){
for (int j=0;j<po;j++){
mn=min(mn,dis[j][i]);
}
}return mn;
}
int main(){
fastio;
cin >> n >> m >> k;
for (int i=0;i<k;i++){
int a;cin >> a;
res.insert(a);
}
for (int i=0;i<m;i++){
int st,en;ll c;
cin >> st >> en >> c;
graph[st].push_back({en,c});
//graph[en].push_back({st,c});
}
int q;cin >> q;
for (int i=0;i<q;i++){
int st,p1,p2,p3,p4,p5;
cin >> st >> p1 >> p2 >> p3 >> p4 >> p5;
//int mask=((p1!=-1)<<4)+((p2!=-1)<<3)+((p3!=-1)<<2)+((p4!=-1)<<1)+((p5!=-1)<<0);
ti={p1,p2,p3,p4,p5};
ll ans=4e18;
ans=min(ans,dijkstra(st));
if (ans!=4e18)cout << ans << "\n";
else cout << -1 << "\n";
}
return 0;
}