#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n, m, k;
int x[N], chk[N], vis[N];
vector<pair<int, int> > con[N];
int dfs(int u, int mid) {
  vis[u] = 1;
  int res = chk[u];
  for (auto it : con[u])
    if (!vis[it.first] && it.second <= mid) res += dfs(it.first, mid);
  return res;
}
bool can(int mid, int n, int k) {
  for (int i = 1; i <= n; i++) vis[i] = 0;
  return dfs(x[1], mid) == k;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> x[i];
    chk[x[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    con[u].push_back({v, w});
    con[v].push_back({u, w});
  }
  int st = 0, en = 1e9 + 10, mid, ans = en;
  while (st <= en) {
    mid = st + en >> 1;
    if (can(mid, n, k)) {
      ans = mid;
      en = mid - 1;
    } else
      st = mid + 1;
  }
  for (int i = 1; i <= k; i++) cout << ans << ' ';
  cout << '\n';
  return 0;
}
