#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct Edge {
  int u, v, c;
  bool operator<(const Edge &o) const { return c < o.c; }
};
vector<Edge> es;
int n, m, k, P[N], specials[N];
bool is_sp[N];
int find(int i) { return i == P[i] ? i : P[i] = find(P[i]); }
vector<pair<int, int> > g[N], g2[N];
pair<int, pair<int, int> > best = {-1, {-1, -1}};
void dfs(int u, int p, int f, int c) {
  if (is_sp[u]) {
    if (f >= 0) {
      g2[f].push_back({u, c});
      g2[u].push_back({f, c});
      best = max(best, {c, {u, f}});
    }
    for (auto e : g[u])
      if (e.first != p) {
        dfs(e.first, u, u, e.second);
      }
  } else {
    for (auto e : g[u])
      if (e.first != p) {
        dfs(e.first, u, f, max(c, e.second));
      }
  }
}
int ans[N];
void dfs1(int u, int p) {
  ans[u] = best.second.second;
  for (auto e : g[u])
    if (e.first != p) {
      dfs1(e.first, u);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset((ans), (-1), sizeof(ans));
  cin >> n >> m >> k;
  for (int x = (0), qwerty = (n); x < qwerty; x++) P[x] = x;
  for (int x = (0), qwerty = (k); x < qwerty; x++)
    cin >> specials[x], specials[x]--, is_sp[specials[x]] = 1;
  for (int x = (0), qwerty = (m); x < qwerty; x++) {
    int u, v, c;
    cin >> u >> v >> c;
    u--;
    v--;
    es.push_back({u, v, c});
  }
  sort((es).begin(), (es).end());
  for (auto e : es) {
    if (find(e.u) != find(e.v)) {
      g[e.u].push_back({e.v, e.c});
      g[e.v].push_back({e.u, e.c});
      P[find(e.u)] = find(e.v);
    }
  }
  dfs(specials[0], -1, -1, -1);
  dfs1(best.second.first, best.second.second);
  for (int x = (0), qwerty = (k); x < qwerty; x++)
    cout << best.first << " \n"[x + 1 == k];
}
