#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int INF = 1e9 + 7;
int sp[N], p[N];
int n, m, k, ex;
struct edge {
  int v, u, w;
};
edge e[N];
inline bool cmp(edge a, edge b) { return a.w < b.w; }
int findp(int v) {
  if (p[v] == v) return v;
  return p[v] = findp(p[v]);
}
void unite(int id) {
  int v = findp(e[id].v), u = findp(e[id].u), w = e[id].w;
  if (v != u) {
    if (sp[v] == 1 && sp[u] == 1) {
      ex--;
      if (ex == 1) {
        for (int i = 1; i <= k; i++) printf("%d ", w);
        exit(0);
      }
    }
    if (sp[v] == 1)
      p[u] = v;
    else
      p[v] = u;
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  ex = k;
  for (int i = 1; i <= n; i++) p[i] = i;
  for (int i = 1; i <= k; i++) {
    int x;
    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, cmp);
  for (int i = 1; i <= m; i++) unite(i);
}
