func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> parent;   vector<int> Rank;   vector<int> Count;   int root(int v) {     if (parent[v] == v) return v;     return parent[v] = root(parent[v]);   }   bool DSU(int a, int b) {     a = root(a);     b = root(b);     if (a != b) {       if (Rank[b] > Rank[a]) swap(a, b);       Rank[a] += Rank[b];       Count[a] += Count[b];       parent[b] = a;       return true;     }     return false;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, m, k;     cin >> n >> m >> k;     vector<pair<long long int, pair<int, int> > > Edges(m);     parent.resize(n + 1);     for (int i = 1; i <= n; i++) parent[i] = i;     Rank.resize(n + 1, 1);     Count.resize(n + 1, 0);     for (int i = 0; i < k; i++) {       int a;       cin >> a;       Count[a] = 1;     }     for (int i = 0; i < m; i++) {       int a, b;       long long int w;       cin >> a >> b >> w;       Edges[i] = make_pair(w, make_pair(a, b));     }     sort(Edges.begin(), Edges.end());     long long int last = -1;     for (int i = 0; i < m; i++) {       int a = Edges[i].second.first;       int b = Edges[i].second.second;       long long int w = Edges[i].first;       if (a != b) {         DSU(a, b);         if (last == -1 && Count[root(a)] == k) {           last = w;         }       }     }     for (int i = 0; i < k; i++) {       cout << last <<    ;     }     return 0;   }   