#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
inline bool is_palindrome(const string& s) {
  return std::equal(s.begin(), s.end(), s.rbegin());
}
const long long MOD = 1000000007;
const long long INF = 1e9 + 5;
const double eps = 1e-7;
const double PI = acos(-1.0);
int n, m, k, u, v, w;
const int N = 1e5 + 5;
bool special[N];
vector<pair<int, pair<int, int> > > edges;
const int FINDSIZE = N;
int p[FINDSIZE], sizes[FINDSIZE], cnt[FINDSIZE];
bool done = false;
int findSet(int i) { return (p[i] == i) ? i : p[i] = findSet(p[i]); }
bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
bool join(int i, int j) {
  if (!isSameSet(i, j)) {
    int x = findSet(i), y = findSet(j);
    if (sizes[x] < sizes[y]) {
      p[x] = y;
      sizes[y] += sizes[x];
      cnt[y] += cnt[x];
    } else {
      p[y] = x;
      sizes[x] += sizes[y];
      cnt[x] += cnt[y];
    }
    if (cnt[x] == k || cnt[y] == k) {
      done = true;
    }
    return true;
  }
  return false;
}
void initialiseUnionFind() {
  for (int i = 0; i < FINDSIZE; i++) {
    p[i] = i;
    sizes[i] = 1;
    cnt[i] = (special[i]) ? 1 : 0;
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  memset(special, false, sizeof(special));
  for (long long i = (long long)(0); i < (long long)(k); i++) {
    cin >> u;
    u--;
    special[u] = true;
  }
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    cin >> u >> v >> w;
    u--;
    v--;
    edges.push_back({w, {u, v}});
  }
  sort(edges.begin(), edges.end());
  initialiseUnionFind();
  long long ans = -1;
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    if (done) {
      break;
    }
    u = edges[i].second.first, v = edges[i].second.second;
    w = edges[i].first;
    if (join(u, v)) {
      ans = w;
    }
  }
  for (long long i = (long long)(0); i < (long long)(k); i++) {
    if (i) {
      cout << " ";
    }
    cout << ans;
  }
  return 0;
}
