#include <bits/stdc++.h>
using namespace std;
vector<long long int> v[100005];
long long int visited[100005];
void dfs(long long int a) {
  visited[a] = 1;
  for (long long int i = 0; i < v[a].size(); i++) {
    if (visited[v[a][i]] == 0) {
      dfs(v[a][i]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t;
  t = 1;
  while (t--) {
    long long int n, m, k, a, b, c, i, l, r, ans, mid, p;
    cin >> n >> m >> k;
    long long int x[k + 2];
    vector<pair<long long int, pair<long long int, long long int> > > v1;
    for (i = 1; i <= k; i++) {
      cin >> x[i];
    }
    for (i = 0; i < m; i++) {
      cin >> a >> b >> c;
      v1.push_back({c, {a, b}});
    }
    l = 1;
    r = 1e9;
    while (l <= r) {
      mid = (l + r) / 2;
      for (i = 1; i <= n; i++) {
        v[i].clear();
        visited[i] = 0;
      }
      for (i = 0; i < m; i++) {
        if (v1[i].first <= mid) {
          a = v1[i].second.first;
          b = v1[i].second.second;
          v[a].push_back(b);
          v[b].push_back(a);
        }
      }
      dfs(x[1]);
      p = 0;
      for (i = 1; i <= k; i++) {
        if (visited[x[i]] == 0) {
          p = 1;
        }
      }
      if (p == 0) {
        ans = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    for (i = 1; i <= k; i++) {
      cout << ans << " ";
    }
  }
}
