#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, k;
int num_spec[N];
int r[N];
int res;
int root(int u) {
  if (r[u] != u) return r[u] = root(r[u]);
  return u;
}
struct tp {
  int u, v, w;
} edge[N];
bool cmp(tp a, tp b) { return a.w < b.w; }
int main() {
  int u, v, w, ru, rv;
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> u;
    num_spec[u]++;
  }
  for (int i = 1; i <= n; i++) r[i] = i;
  for (int i = 1; i <= m; i++) cin >> edge[i].u >> edge[i].v >> edge[i].w;
  sort(edge + 1, edge + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    u = edge[i].u, v = edge[i].v, w = edge[i].w;
    ru = root(u), rv = root(v);
    if (ru != rv) {
      r[ru] = rv;
      num_spec[rv] += num_spec[ru];
      if (num_spec[rv] == k) {
        res = w;
        break;
      }
    }
  }
  for (int i = 1; i <= k; i++) cout << res << " ";
}
