#include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int> > > edges;
vector<int> special;
int parent[100005], p_size[100005], sp_size[100005];
int find(int i) {
  while (parent[i] != i) {
    parent[i] = parent[parent[i]];
    i = parent[i];
  }
  return i;
}
void ds_union(int u, int v) {
  int root_u = find(u);
  int root_v = find(v);
  if (p_size[root_u] < p_size[root_v]) {
    parent[root_u] = parent[root_v];
    p_size[root_v] += p_size[root_u];
    sp_size[root_v] += sp_size[root_u];
  } else {
    parent[root_v] = parent[root_u];
    p_size[root_u] += p_size[root_v];
    sp_size[root_u] += sp_size[root_v];
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    parent[i] = i;
    p_size[i] = 1;
  }
  for (int i = 1; i <= k; i++) {
    int x;
    cin >> x;
    special.push_back(x);
    sp_size[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    edges.push_back({w, {u, v}});
  }
  sort(edges.begin(), edges.end());
  int ans = 0;
  for (int i = 0; i < edges.size(); i++) {
    int u = edges[i].second.first;
    int v = edges[i].second.second;
    if (find(u) != find(v)) {
      ds_union(u, v);
      ans = edges[i].first;
      int x = find(u);
      if (sp_size[x] == special.size()) {
        for (int j = 0; j < k; j++) {
          cout << ans << " ";
        }
        return 0;
      }
    }
  }
  return 0;
}
