#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v, w;
} e[100004];
int f[100004], n, m, k;
int sp[100004];
inline bool dex(edge A, edge B) { return A.w < B.w; }
int Find(int x) { return (f[x] == x) ? x : f[x] = Find(f[x]); }
int w33ha() {
  memset(sp, 0, sizeof(sp));
  for (int i = 1; i <= n; i++) f[i] = i;
  int x;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &x);
    sp[x] = 1;
  }
  for (int i = 1; i <= m; i++) scanf("%d%d%d", &e[i].u, &e[i].v, &e[i].w);
  sort(e + 1, e + m + 1, dex);
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    int p = Find(e[i].u), q = Find(e[i].v);
    if (p != q) {
      if (sp[p] && sp[q])
        ans = max(ans, e[i].w);
      else if (sp[p] || sp[q]) {
        sp[p] = 1;
        sp[q] = 1;
      }
      f[p] = q;
    }
  }
  for (int i = 1; i < k; i++) printf("%d ", ans);
  printf("%d\n", ans);
  return 0;
}
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) w33ha();
  return 0;
}
