#include <bits/stdc++.h>
using namespace std;
long long link[111111], sz[111111], cont[111111], point[111111][2];
vector<pair<long long, long long>> arr2;
long long findLink(long long x) {
  while (x != link[x]) x = link[x];
  return x;
}
long long isSameLink(long long a, long long b) {
  return findLink(a) == findLink(b);
}
void unite(long long a, long long b) {
  a = findLink(a);
  b = findLink(b);
  if (a == b) return;
  if (sz[a] < sz[b]) swap(a, b);
  cont[a] += cont[b];
  sz[a] += sz[b];
  link[b] = a;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  for (long long i = 0; i <= n; i++) {
    sz[i] = 1;
    link[i] = i;
  }
  for (long long i = 0; i < k; i++) {
    long long x;
    cin >> x;
    cont[x] = 1;
  }
  for (long long i = 0; i < m; i++) {
    long long x, y, w;
    cin >> x >> y >> w;
    point[i][0] = x;
    point[i][1] = y;
    arr2.push_back(make_pair(w, i));
  }
  sort(arr2.begin(), arr2.end());
  for (long long i = 0; i < m; i++) {
    long long index = arr2[i].second;
    long long x = point[index][0], y = point[index][1];
    if (findLink(x) == findLink(y)) continue;
    unite(x, y);
    long long z = findLink(x);
    if (cont[z] >= k) {
      for (long long j = 0; j < k; j++) cout << arr2[i].first << " ";
      return 0;
    }
  }
  return 0;
}
