#include <bits/stdc++.h>
#pragma comment(linker, "/stack:225450978")
#pragma GCC optimize("Ofast")
using namespace std;
const long long Mod = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double Pi = 3.141592653589793116, EPS = 1e-9,
                  Gold = ((1 + sqrt(5)) / 2);
long long keymod[] = {1000000007LL, 1000000009LL, 1000000021LL, 1000000033LL};
long long keyCount = sizeof(keymod) / sizeof(long long);
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcountll(s);
}
auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();
void ControlIO(int argc, char* argv[]);
void TimerStart();
void TimerStop();
void Exit();
string cppstr_infile = "FILE.IN";
string cppstr_outfile = "FILE.OUT";
long long n, m, k;
vector<long long> x;
vector<pair<pair<long long, long long>, long long> > Edge;
vector<long long> DSUpar, DSUsize, DSUspecial;
long long answer = -1;
long long DSUfind(long long z) {
  while (DSUpar[z] != -1) z = DSUpar[z];
  return z;
}
void DSUmerge(long long u, long long v, long long w) {
  u = DSUfind(u);
  v = DSUfind(v);
  if (u == v) return;
  if (DSUsize[u] < DSUsize[v]) swap(u, v);
  DSUsize[u] += DSUsize[v];
  DSUpar[v] = u;
  DSUspecial[u] += DSUspecial[v];
  if (answer == -1 && DSUspecial[u] == k) answer = w;
}
bool edgesort(pair<pair<long long, long long>, long long> A,
              pair<pair<long long, long long>, long long> B) {
  return (A.second < B.second);
}
void Input() {
  cin >> n >> m >> k;
  x.resize(k);
  Edge.resize(m);
  DSUpar.resize(n, -1);
  DSUsize.resize(n, +1);
  DSUspecial.resize(n, 0);
  for (auto& z : x) {
    cin >> z;
    z--;
    DSUspecial[z]++;
  }
  for (auto& E : Edge) {
    cin >> E.first.first >> E.first.second >> E.second;
    E.first.first--;
    E.first.second--;
  }
}
void Solve() {
  sort(Edge.begin(), Edge.end(), edgesort);
  for (auto E : Edge) {
    long long u = E.first.first, v = E.first.second;
    long long w = E.second;
    DSUmerge(u, v, w);
  }
  for (long long i = 0; i < k; i++) cout << answer << " ";
  cout << '\n';
}
int main(int argc, char* argv[]) {
  ControlIO(argc, argv);
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  Input();
  TimerStart();
  Solve();
  TimerStop();
  return 0;
}
void ControlIO(int argc, char* argv[]) {
  char* infile = new char[cppstr_infile.size() + 1];
  char* outfile = new char[cppstr_outfile.size() + 1];
  strcpy(infile, cppstr_infile.c_str());
  strcpy(outfile, cppstr_outfile.c_str());
}
void TimerStart() {}
void TimerStop() {}
void Exit() {
  TimerStop();
  exit(0);
}
