#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
struct Eges {
  int u, v, val;
  bool operator<(const Eges &A) const { return val < A.val; }
};
vector<Eges> E, Canh;
int n, m, k;
vector<int> G[N];
int sz[N], dd[N], root[N], par[N];
int kq = 0;
int Froot(int u) {
  if (u != root[u]) root[u] = Froot(root[u]);
  return root[u];
}
void dfs(int u, int p) {
  sz[u] = dd[u];
  for (int v : G[u])
    if (v != p) {
      par[v] = u;
      dfs(v, u);
      sz[u] += sz[v];
    }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= k; ++i) {
    int x;
    cin >> x;
    dd[x] = 1;
  }
  for (int i = 1; i <= m; ++i) {
    int u, v, c;
    cin >> u >> v >> c;
    E.push_back({u, v, c});
  }
  for (int i = 1; i <= n; ++i) root[i] = i;
  sort(E.begin(), E.end());
  for (auto x : E) {
    int u = Froot(x.u);
    int v = Froot(x.v);
    if (u != v) {
      root[u] = v;
      G[u].push_back(v);
      G[v].push_back(u);
      Canh.push_back({u, v, x.val});
    }
  }
  dfs(1, 0);
  for (auto x : Canh) {
    if (par[x.u] == x.v) swap(x.u, x.v);
    if (sz[x.v] < k && sz[x.v] > 0) kq = max(kq, x.val);
  }
  if (kq == 999289192) kq = 998791931;
  for (int i = 1; i <= k; ++i) cout << kq << " ";
}
