#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void setmin(T &x, T y) {
  if (y < x) x = y;
}
template <typename T>
inline void setmax(T &x, T y) {
  if (y > x) x = y;
}
template <typename T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return a;
}
const int MAX = 1e5 + 7;
const int T = 1 << 20;
const int INF = 1e9 + 7;
const long long BIG_INF = 1e18 + 5;
long double e = 2.7182818284590452353602874713526624;
long double PI = acos(-1);
long double eps = 1e-19;
long long mod = 998244353;
long long n, m, k, t;
long long wynik;
int REP[MAX];
int ROZ[MAX];
int wazny[MAX];
priority_queue<pair<int, pair<int, int> > > kol;
int fajnd(int x) { return REP[x] == x ? x : REP[x] = fajnd(REP[x]); }
void onion(int a, int b) {
  ROZ[fajnd(b)] += ROZ[fajnd(a)];
  if (ROZ[fajnd(b)] == k) {
    for (int i = 1; i <= k; ++i) {
      cout << wynik << ' ';
    }
    exit(0);
  }
  REP[fajnd(a)] = fajnd(b);
}
void elo() {
  while (int((kol).size())) {
    auto CAR = kol.top();
    kol.pop();
    int koszt = -CAR.first;
    int jeden = CAR.second.first;
    int dwa = CAR.second.second;
    if (fajnd(jeden) != fajnd(dwa)) {
      wynik = max(wynik, (long long)koszt);
      onion(jeden, dwa);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> k;
  wazny[0] = 1;
  for (int i = 1; i <= n; i++) {
    REP[i] = i;
  }
  for (int i = 0; i < k; i++) {
    cin >> t;
    wazny[t] = 1;
    ROZ[t] = 1;
  }
  for (int i = 0; i < m; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    if (a == b) {
      continue;
    }
    kol.push({-c, {a, b}});
  }
  elo();
  return 0;
}
