#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<int, int> > adj[N];
bool visit[N], spec[N];
int dijstra(int src) {
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      q;
  q.push({0, src});
  int maxi = 0;
  while (!q.empty()) {
    int u = q.top().second;
    int c = q.top().first;
    q.pop();
    if (visit[u]) continue;
    if (spec[u]) maxi = max(maxi, c);
    visit[u] = 1;
    for (auto v : adj[u]) {
      if (!visit[v.first]) q.push({max(c, v.second), v.first});
    }
  }
  return maxi;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int x;
  for (int i = 0; i < k; ++i) {
    scanf("%d", &x);
    spec[x] = 1;
  }
  for (int i = 0; i < m; ++i) {
    int u, v, c;
    scanf("%d%d%d", &u, &v, &c);
    adj[u].push_back({v, c});
    adj[v].push_back({u, c});
  }
  int ans = dijstra(x);
  for (int i = 0; i < k; ++i) printf("%d%c", ans, " \n"[i + 1 == k]);
  return 0;
}
