#include <bits/stdc++.h>
using namespace std;
int n, m, k, dsu[100005] = {0}, x, ans, p;
set<int> specialVertices, numberOfComponents;
pair<int, pair<int, int> > edges[100005];
void initDSU() {
  for (int i = 1; i <= n; i++) dsu[i] = i;
}
int findDSU(int u) { return u == dsu[u] ? u : dsu[u] = findDSU(dsu[u]); }
void unionDSU(int u, int v) {
  u = findDSU(u);
  v = findDSU(v);
  if (u != v) {
    if (specialVertices.count(v)) swap(u, v);
    dsu[v] = u;
    if (specialVertices.count(u) && specialVertices.count(v)) {
      p--;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  initDSU();
  p = k;
  for (int i = 1; i <= k; i++) {
    cin >> x;
    specialVertices.insert(x);
  }
  for (int i = 1; i <= m; i++) {
    cin >> edges[i].second.first >> edges[i].second.second >> edges[i].first;
  }
  sort(edges + 1, edges + 1 + m);
  for (int i = 1; i <= m; i++) {
    if (findDSU(edges[i].second.first) != findDSU(edges[i].second.second)) {
      unionDSU(edges[i].second.first, edges[i].second.second);
    }
    if (p == 1) {
      ans = edges[i].first;
      break;
    }
  }
  for (int i = 1; i <= k; i++) cout << ans << ' ';
  return 0;
}
