#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int u[maxn];
void Start() {
  for (int i = 0; i < maxn; i++) u[i] = i;
}
int Find(int x) {
  if (x == u[x]) return x;
  return u[x] = Find(u[x]);
}
int xk[maxn], vk[maxn], mx = 0;
vector<pair<int, int> > e[maxn];
int dfs(int s) {
  vk[s] = 1;
  int sx = xk[s];
  for (auto n : e[s]) {
    if (!vk[n.first]) {
      int u = dfs(n.first);
      if (u > 0) mx = max(mx, n.second);
      sx += u;
    }
  }
  return sx;
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  int rt;
  for (int i = 0; i < k; i++) {
    int x;
    scanf("%d", &x);
    xk[x] = 1;
    rt = x;
  }
  vector<tuple<int, int, int> > ee;
  for (int i = 0; i < m; i++) {
    int u, v, w;
    scanf("%d %d %d", &u, &v, &w);
    ee.push_back(make_tuple(w, u, v));
  }
  Start();
  sort(ee.begin(), ee.end());
  for (int i = 0; i < m; i++) {
    int u, v, w;
    tie(w, u, v) = ee[i];
    if (Find(u) != Find(v)) {
      ::u[Find(u)] = Find(v);
      e[u].push_back({v, w});
      e[v].push_back({u, w});
    }
  }
  dfs(rt);
  for (int i = 0; i < k; i++) printf("%d ", mx);
  printf("\n");
  return 0;
}
