#include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int> > > v;
int par[100005];
int spec[100005];
int parent(int x) {
  if (par[x] != x) par[x] = parent(par[x]);
  return par[x];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int ele, x, y, w, parx, pary, n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i < n + 1; i++) par[i] = i;
  for (int i = 0; i < k; i++) {
    cin >> ele;
    spec[ele] = 1;
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y >> w;
    v.push_back(make_pair(w, make_pair(x, y)));
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    x = v[i].second.first;
    y = v[i].second.second;
    w = v[i].first;
    parx = parent(x);
    pary = parent(y);
    if (parx == pary) continue;
    spec[parx] += spec[pary];
    par[pary] = parx;
    if (spec[parx] == k) {
      for (int j = 0; j < k; j++) {
        cout << w << " ";
      }
      return 0;
    }
  }
}
