#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-5;
const long double PI = acos(-1);
const int INF = (int)1e9;
const long long INFF = (long long)1e18;
const int mod = (int)998244353;
const int MXN = (int)2e5 + 7;
vector<pair<int, int> > edge[MXN];
pair<int, pair<int, int> > st[MXN];
int op[MXN];
int siz[MXN], gp[MXN];
int fd(int v) { return gp[v] == v ? v : gp[v] = fd(gp[v]); }
void uni(int u, int v) {
  u = fd(u), v = fd(v);
  if (u == v) return;
  if (siz[u] > siz[v]) swap(u, v);
  gp[u] = v;
  siz[v] += siz[u];
}
int ans = 0;
int num[MXN];
int n, m, k;
void dfs(int u, int pa) {
  for (pair<int, int> x : edge[u]) {
    if (x.first == pa) continue;
    dfs(x.first, u);
    num[u] += num[x.first];
    if (num[x.first] != k && num[x.first]) ans = max(ans, x.second);
  }
  if (op[u]) num[u]++;
}
int main(void) {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i < k + 1; ++i) {
    int v;
    scanf("%d", &v);
    op[v] = 1;
  }
  for (int i = 1; i < m + 1; ++i) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    st[i] = make_pair(w, make_pair(u, v));
  }
  sort(st + 1, st + m + 1);
  for (int i = 1; i < n + 1; ++i) siz[i] = 1, gp[i] = i;
  for (int i = 1; i < m + 1; ++i) {
    int u, v;
    tie(u, v) = st[i].second;
    if (fd(u) == fd(v)) continue;
    uni(u, v);
    edge[u].push_back(make_pair(v, st[i].first));
    edge[v].push_back(make_pair(u, st[i].first));
  }
  dfs(1, 0);
  if (k == 1) ans = 0;
  for (int i = 1; i < k + 1; ++i) printf("%d%c", ans, " \n"[i == k]);
  return 0;
}
