#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using piii = pair<int, pii>;
using plll = pair<ll, pll>;
using pib = pair<int, bool>;
using pdi = pair<double, int>;
using pid = pair<int, double>;
using ld = long double;
using piiii = pair<pii, pii>;
int n, m, k, a, b, c, djs[100001];
bool first[100001];
vector<piii> edges;
pii find(int u) {
  if (djs[u] != u) {
    pii p = find(djs[u]);
    djs[u] = p.first;
    first[u] |= p.second;
  }
  return {djs[u], first[u]};
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> a;
    first[a] = true;
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b >> c;
    edges.push_back({c, {a, b}});
  }
  for (int i = 1; i <= n; i++) {
    djs[i] = i;
  }
  int t = 0;
  sort(edges.begin(), edges.end());
  for (int i = 0; i < edges.size(); i++) {
    pii p1 = find(edges[i].second.first);
    pii p2 = find(edges[i].second.second);
    if (p1.first != p2.first) {
      if (p1.second && p2.second) t++;
      if (t == k - 1) {
        for (int j = 0; j < k; j++) {
          cout << edges[i].first << " ";
        }
        cout << "\n";
        return 0;
      }
      djs[p1.first] = p2.first;
      if (p1.second) first[p2.first] = true;
    }
  }
  return 0;
}
