#include <bits/stdc++.h>
using namespace std;
int Read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
const int N = 100000 + 5;
int n, m, k, st, ans, x[N], inset[N], fa[N], dis[N];
int find(int x) { return x == fa[x] ? fa[x] : fa[x] = find(fa[x]); }
vector<pair<int, int> > g1[N];
struct edge {
  int u, v, w;
} e[N];
void dfs(int u, int pre, int w) {
  dis[u] = max(dis[pre], w);
  for (int i = 0; i < g1[u].size(); i++) {
    int v = g1[u][i].first;
    if (v == pre) continue;
    dfs(v, u, g1[u][i].second);
  }
}
bool compare(const edge& uu, const edge& vv) { return uu.w < vv.w; }
void Kruskal() {
  int ans = 0, res = 0;
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int u = e[i].u, v = e[i].v, w = e[i].w;
    if (find(u) == find(v)) continue;
    fa[find(u)] = find(v);
    ++ans;
    g1[u].push_back({v, w});
    g1[v].push_back({u, w});
    if (ans == n - 1) break;
  }
  dfs(st, 0, 0);
  for (int i = 1; i <= n; i++) res = max(res, inset[i] * dis[i]);
  while (k--) cout << res << " ";
  return;
}
int main() {
  n = Read(), m = Read(), k = Read();
  for (int i = 1; i <= k; i++) x[i] = Read(), inset[x[i]] = 1, st = x[i];
  for (int i = 1; i <= m; i++) {
    e[i].u = Read();
    e[i].v = Read();
    e[i].w = Read();
  }
  sort(e + 1, e + m + 1, compare);
  Kruskal();
  return 0;
}
