#include <bits/stdc++.h>
using namespace std;
void yes() {
  cout << "YES"
       << "\n";
}
void no() {
  cout << "NO"
       << "\n";
}
vector<pair<long long, pair<int, int>>> v;
vector<int> dsu(100001);
vector<int> s(100001);
vector<pair<long long, long long>> v2[100001];
int find(int i) {
  if (i == dsu[i]) return i;
  dsu[i] = find(dsu[i]);
  return dsu[i];
}
void combine(int a, int b) {
  int x = find(a), y = find(b);
  if (s[x] < s[y]) {
    s[y] += s[x];
    dsu[x] = y;
  } else {
    s[x] += s[y];
    dsu[y] = x;
  }
}
long long mi = 0;
set<int> v1;
bool dfs(int i, int p) {
  bool b1 = 0;
  for (auto j : v2[i]) {
    if (j.second != p) {
      bool b = dfs(j.second, i);
      if (b) {
        b1 = 1;
        mi = max(j.first, mi);
      }
    }
  }
  if (v1.find(i) != v1.end()) return true;
  return b1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, k, a, b, x, y, c;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> a;
    v1.insert(a);
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b >> c;
    v.push_back(make_pair(c, make_pair(a, b)));
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n; i++) {
    dsu[i] = i;
    s[i] = 1;
  }
  for (auto j : v) {
    c = j.first;
    x = j.second.first;
    y = j.second.second;
    a = find(x);
    b = find(y);
    if (a == b)
      continue;
    else {
      combine(a, b);
      v2[x].push_back(make_pair(c, y));
      v2[y].push_back(make_pair(c, x));
    }
  }
  dfs(*v1.begin(), -1);
  for (int i = 0; i < k; i++) cout << mi << " ";
  return 0;
}
