#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int> > > graph(100005);
int x[100005];
int dist[100005];
bool mp[100005];
void dijkstra(int n) {
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      pq;
  pq.push(pair<int, int>(0, n));
  while (!pq.empty()) {
    pair<int, int> t = pq.top();
    pq.pop();
    int u = t.second, w = t.first;
    if (w > dist[u]) continue;
    for (int i = 0; i < graph[u].size(); i++) {
      pair<int, int> v = graph[u][i];
      if (max(dist[u], v.first) < dist[v.second]) {
        dist[v.second] = max(dist[u], v.first);
        pq.push(pair<int, int>(dist[v.second], v.second));
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> x[i];
    mp[x[i]] = true;
  }
  for (int i = 0; i < m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    graph[u].push_back(pair<int, int>(w, v));
    graph[v].push_back(pair<int, int>(w, u));
  }
  for (int i = 0; i <= n; i++) {
    if (i == x[0])
      dist[i] = 0;
    else
      dist[i] = 1e9 + 7;
  }
  dijkstra(x[0]);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (mp[i]) ans = max(ans, dist[i]);
  }
  for (int i = 0; i < k; i++) cout << ans << " ";
}
