#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<long long, long long> > > adj;
vector<long long> x;
vector<bool> vis;
long long n, m, k;
void dfs(long long r, long long val) {
  vis[r] = true;
  for (long long i = 0; i < adj[r].size(); i++) {
    long long c = adj[r][i].first;
    long long w = adj[r][i].second;
    if (w >= val) continue;
    if (vis[c]) continue;
    dfs(c, val);
  }
}
bool check(long long val) {
  vis.clear();
  vis.resize(n, false);
  dfs(x[0], val);
  for (long long i = 0; i < k; i++) {
    if (!vis[x[i]]) return true;
  }
  return false;
}
long long solve(long long l, long long r) {
  while (true) {
    long long len = (r - l) + 1;
    if (len == 1) {
      return l;
    } else if (len == 2) {
      if (check(r))
        return r;
      else
        return l;
    } else {
      long long mid = (l + r) / 2;
      if (check(mid)) {
        if (!check(mid + 1))
          return mid;
        else
          l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  adj.resize(n);
  x.resize(k);
  for (long long i = 0; i < k; i++) {
    cin >> x[i];
    x[i]--;
  }
  for (long long i = 0; i < m; i++) {
    long long u, v, w;
    cin >> u >> v >> w;
    u--;
    v--;
    adj[u].push_back(make_pair(v, w));
    adj[v].push_back(make_pair(u, w));
  }
  long long val = solve(1, 1e9);
  for (long long i = 0; i < k; i++) {
    cout << val << ' ';
  }
  return 0;
}
