#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 5, inf = 2e9;
int n, vr[mx], m, k, maxx, dis[mx], cnt;
vector<pair<int, int> > adj[mx];
set<pair<int, int> > st;
bool mark[mx], boo[mx];
void dks(int v) {
  dis[v] = 0;
  st.insert(make_pair(0, v));
  while (cnt != n) {
    auto at = st.begin();
    int ver = (*at).second;
    st.erase(st.begin());
    if (mark[ver]) continue;
    mark[ver] = 1;
    cnt++;
    if (boo[ver] == 1)
      if (maxx < dis[ver]) maxx = dis[ver];
    for (int i = 0; i < adj[ver].size(); i++) {
      int u = adj[ver][i].first;
      int w = adj[ver][i].second;
      if (!mark[u]) {
        w = max(w, dis[ver]);
        if (dis[u] > w) {
          dis[u] = w;
          st.insert(make_pair(w, u));
        }
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < mx; i++) dis[i] = inf;
  for (int i = 0; i < k; i++) {
    cin >> vr[i];
    boo[vr[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    int v, u, w;
    cin >> v >> u >> w;
    adj[v].push_back(make_pair(u, w)), adj[u].push_back(make_pair(v, w));
  }
  dks(vr[0]);
  for (int i = 0; i < k; i++) {
    cout << maxx << " ";
  }
  return 0;
}
