#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, k;
int par[N], sp[N], check[N], res = 0, p[N], loop[N], should[N];
vector<pair<int, int> > adj[N];
queue<int> q;
pair<int, pair<int, int> > edge[N];
int root(int u) { return par[u] < 0 ? u : (par[u] = root(par[u])); }
bool join(int u, int v) {
  if ((u = root(u)) == (v = root(v))) return false;
  if (par[u] > par[v]) swap(u, v);
  par[u] += par[v];
  par[v] = u;
  return true;
}
void CalcLeaf(int u, int parent) {
  p[u] = parent;
  should[u] = sp[u];
  if (adj[u].size() == 1 && parent != -1 && !sp[u]) q.push(u);
  for (pair<int, int> a : adj[u])
    if (a.first != parent) CalcLeaf(a.first, u), should[u] |= should[a.first];
}
void dfs(int u, int parent) {
  for (pair<int, int> a : adj[u])
    if (!check[a.first] && a.first != parent)
      res = max(res, a.second), dfs(a.first, u);
}
int main() {
  if (fopen("train.inp", "r")) {
    freopen("train.inp", "r", stdin);
    freopen("train.out", "w", stdout);
  }
  int root;
  memset(par, -1, sizeof(par));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    sp[x] = 1;
    root = x;
  }
  memset(loop, 60, sizeof(loop));
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &edge[i].second.first, &edge[i].second.second,
          &edge[i].first);
    if (edge[i].second.first == edge[i].second.second &&
        sp[edge[i].second.second])
      loop[edge[i].second.first] =
          min(loop[edge[i].second.first], edge[i].first);
  }
  sort(edge + 1, edge + 1 + m);
  for (int i = 1; i <= m; i++)
    if (join(edge[i].second.first, edge[i].second.second))
      adj[edge[i].second.first].push_back(
          pair<int, int>(edge[i].second.second, edge[i].first)),
          adj[edge[i].second.second].push_back(
              pair<int, int>(edge[i].second.first, edge[i].first));
  CalcLeaf(root, -1);
  while (q.size()) {
    int u = q.front();
    q.pop();
    check[u] = 1;
    if (!check[p[u]] && !sp[p[u]] && !should[p[u]]) q.push(p[u]);
  }
  dfs(root, -1);
  for (int i = 1; i <= k; i++) printf("%d ", res);
}
