#include <bits/stdc++.h>
using namespace std;
struct edg {
  int u, v, w;
} ed[100005];
struct edge {
  int v, w, next;
} e[200005];
int color[100005], pnt[100005], head[100005];
int ecnt = 0, ans;
int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
bool cmp(edg x, edg y) { return x.w < y.w; }
int fa(int x) { return (pnt[x] == x) ? x : pnt[x] = fa(pnt[x]); }
void addedge(int u, int v, int w) {
  e[ecnt].v = v;
  e[ecnt].w = w;
  e[ecnt].next = head[u];
  head[u] = ecnt++;
}
bool dfs(int x, int fa) {
  bool f = false;
  for (int i = head[x]; i >= 0; i = e[i].next) {
    int v = e[i].v;
    if (v == fa) continue;
    if (dfs(v, x)) {
      ans = max(ans, e[i].w);
      f = true;
    }
  }
  return f | color[x];
}
int main() {
  int n = read(), m = read(), k = read();
  for (int i = 1; i <= k; i++) {
    int x = read();
    color[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    ed[i].u = read();
    ed[i].v = read();
    ed[i].w = read();
  }
  sort(ed + 1, ed + m + 1, cmp);
  for (int i = 1; i <= n; i++) pnt[i] = i;
  memset(head, -1, sizeof(head));
  for (int i = 1; i <= m; i++) {
    int fu = fa(ed[i].u), fv = fa(ed[i].v);
    if (fu != fv) {
      addedge(ed[i].u, ed[i].v, ed[i].w);
      addedge(ed[i].v, ed[i].u, ed[i].w);
      pnt[fu] = fv;
    }
  }
  ans = -1;
  for (int i = 1; i <= n; i++)
    if (color[i]) {
      dfs(i, -1);
      break;
    }
  for (int i = 1; i <= k; i++) printf("%d%c", ans, (i == k) ? '\n' : ' ');
  return 0;
}
