#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, K, cnt, head[N], x[N], val[N], p[N], ans, vis[N], fa[N];
struct edge {
  int to, nxt, w;
} e[N << 1];
void adde(int x, int y, int w) {
  e[++cnt].to = y;
  e[cnt].nxt = head[x];
  head[x] = cnt;
  e[cnt].w = w;
}
struct node {
  int x, y, w;
} a[N];
bool cmp(node x, node y) { return x.w < y.w; }
int getfa(int x) { return x == fa[x] ? x : fa[x] = getfa(fa[x]); }
int dfs(int u, int par) {
  int sz = 0;
  for (int i = head[u], v; i; i = e[i].nxt)
    if (v = e[i].to, v != par) {
      val[v] = e[i].w;
      p[v] = dfs(v, u);
      if (p[v]) sz++;
    }
  if (sz >= 2 || vis[u]) {
    for (int i = head[u], v; i; i = e[i].nxt)
      if (v = e[i].to, v != par && p[v]) ans = max(ans, val[v]);
  } else if (sz == 1) {
    for (int i = head[u], v; i; i = e[i].nxt)
      if (v = e[i].to, v != par && p[v]) val[u] = max(val[u], val[v]);
  }
  return sz >= 1 || vis[u];
}
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = (1); i <= (K); i++) scanf("%d", &x[i]), vis[x[i]] = 1;
  for (int i = (1); i <= (m); i++) scanf("%d%d%d", &a[i].x, &a[i].y, &a[i].w);
  sort(a + 1, a + 1 + m, cmp);
  for (int i = (1); i <= (n); i++) fa[i] = i;
  int edgenum = 0;
  for (int i = (1); i <= (m); i++) {
    if (edgenum == n - 1) break;
    int x = getfa(a[i].x), y = getfa(a[i].y), w = a[i].w;
    if (x != y) {
      fa[x] = y;
      adde(a[i].x, a[i].y, w);
      adde(a[i].y, a[i].x, w);
      edgenum++;
    }
  }
  int rt = x[1];
  dfs(rt, 0);
  for (int i = (1); i <= (K); i++) printf("%d ", ans);
  return 0;
}
