#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, siz = 1e6 + 5;
long long t, n, m, k, a[siz], sp[siz], par[siz];
struct edges {
  long long x, y, w;
} edg[siz];
bool cmp(edges a, edges b) { return a.w < b.w; }
long long get_par(long long u) {
  if (u == par[u]) return u;
  return par[u] = get_par(par[u]);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (long long i = 1; i <= k; i++) cin >> t, sp[t] = 1;
  for (long long i = 1; i <= m; i++) cin >> edg[i].x >> edg[i].y >> edg[i].w;
  sort(edg + 1, edg + 1 + m, cmp);
  for (long long i = 1; i <= n; i++) par[i] = i;
  long long ans;
  for (long long i = 1; i <= m; i++) {
    long long u = get_par(edg[i].x), v = get_par(edg[i].y);
    if (u == v) continue;
    sp[u] += sp[v];
    par[v] = u;
    if (sp[u] == k) {
      ans = edg[i].w;
      break;
    }
  }
  for (long long i = 1; i <= k; i++) cout << ans << " ";
}
