#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int Max = 1000;
int arr[1000000];
int Size[1000000];
void makeSet(int v) {
  for (int i = 0; i < v; i++) {
    arr[i] = i;
    Size[i] = 1;
  }
}
int find(int u) {
  if (arr[u] == u) return u;
  arr[u] = find(arr[u]);
  return arr[u];
}
void munion(int u, int v) {
  int rootu = find(u);
  int rootv = find(v);
  if (rootu == rootv) return;
  if (Size[rootu] < Size[rootv]) {
    arr[rootu] = arr[rootv];
    Size[rootv] += Size[rootu];
  } else {
    arr[rootv] = arr[rootu];
    Size[rootu] += Size[rootv];
  }
}
bool cmp(pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
  return a.first < b.first;
}
int in[100001], out[100001];
int vert[100001];
int dfs1Util(int u, int par, vector<pair<int, int>> adj[]) {
  if (vert[u] == 1) in[u] = 1;
  for (auto v : adj[u]) {
    if (v.first != par) {
      dfs1Util(v.first, u, adj);
      in[u] += in[v.first];
    }
  }
  return in[u];
}
void dfs1(vector<pair<int, int>> adj[], int v) { dfs1Util(0, -1, adj); }
int ans = 0;
void dfs2Util(int u, int par, vector<pair<int, int>> adj[]) {
  int mx1 = 0, mx2 = 0;
  for (auto v : adj[u]) {
    if (v.first != par) {
      if (in[v.first] > mx1) {
        mx2 = mx1;
        mx1 = in[v.first];
      } else if (in[v.first] > mx2) {
        mx2 = in[v.first];
      }
    }
  }
  for (auto v : adj[u]) {
    if (v.first != par) {
      int longest = mx1;
      if (longest == in[v.first]) longest = mx2;
      out[v.first] = max(out[u], longest) + ((vert[v.first] == 1) ? 1 : 0);
      if (in[v.first] > 0 && (out[u] > 0 || longest > 0)) {
        ans = max(ans, v.second);
      }
      dfs2Util(v.first, u, adj);
    }
  }
}
void dfs2(vector<pair<int, int>> adj[], int v) {
  out[0] = ((vert[0] == 1) ? 1 : 0);
  dfs2Util(0, -1, adj);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int V, E, k;
  cin >> V >> E >> k;
  for (int i = 0; i < V; i++) vert[i] = 0;
  for (int i = 0; i < k; i++) {
    int node;
    cin >> node;
    node--;
    vert[node] = 1;
  }
  vector<pair<int, pair<int, int>>> edges;
  vector<pair<int, int>> adj[V];
  for (int i = 0; i < E; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    edges.push_back(make_pair(w, make_pair(u, v)));
  }
  sort(edges.begin(), edges.end(), cmp);
  makeSet(V);
  for (int i = 0; i < E; i++) {
    int u = edges[i].second.first;
    int v = edges[i].second.second;
    int w = edges[i].first;
    int rootu = find(u);
    int rootv = find(v);
    if (rootu == rootv) continue;
    munion(u, v);
    adj[u].push_back(make_pair(v, w));
    adj[v].push_back(make_pair(u, w));
  }
  dfs1(adj, V);
  dfs2(adj, V);
  for (int i = 0; i < k; i++) {
    cout << ans << " ";
  }
  cout << endl;
}
