#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int f[100005];
int x[100005];
int cnt[100005];
vector<pair<int, pair<int, int>>> v;
int getf(int k) { return (f[k] == k) ? k : f[k] = getf(f[k]); }
int unite(int x, int y, int w) {
  x = getf(x);
  y = getf(y);
  if (x == y) return 0;
  if (x != y) {
    f[y] = x;
    if (cnt[x] > 0 && cnt[y] > 0) {
      cnt[x] += cnt[y];
      return w;
    }
    cnt[x] += cnt[y];
    return 0;
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    scanf("%d", &x[i]);
    cnt[x[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    int a, b, w;
    scanf("%d%d%d", &a, &b, &w);
    v.push_back(make_pair(w, pair<int, int>(a, b)));
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n; i++) f[i] = i;
  int ans = 0;
  for (int i = 0; i < v.size(); i++)
    ans = max(ans, unite(v[i].second.first, v[i].second.second, v[i].first));
  for (int i = 0; i < k; i++) printf("%d ", ans);
  return 0;
}
