#include <bits/stdc++.h>
#define int long long
int v,e,q;
int dist[100010];
std::vector<std::pair<int,int>> adj[100010];
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin >> v >> e >> q;
for(int i=1;i<=e;i++){
int a,b,w;
std::cin >> a >> b >> w;
adj[a].push_back({b,w});
adj[b].push_back({a,w});
}
std::priority_queue<std::pair<int,int>> pq;
pq.push({1e18,1});
dist[1]=1e18;
while(!pq.empty()){
int qual = pq.top().first;
int node = pq.top().second;
pq.pop();
for(auto [to,parq]:adj[node]){
if(dist[to]<std::min(parq,qual)){
dist[to]=std::min(parq,qual);
pq.push({dist[to],to});
}
}
}
while(q--){
int ask;
std::cin >> ask;
std::cout << dist[ask] << '\n';
}
}