#include #include #include using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) using i64=long long; int main(){ int n, m, k; cin>> n>> m>> k; assert(1<=n and n<=100000); assert(0<=m and m<=100000); assert(0<=k and k<=m); assert(n-1<=m); assert((i64)m<=(i64)n*(n-1)/2); set> edgeset; rep(_, m){ int a, b; i64 c; cin>> a>> b>> c; assert(1<=a and a<=n); assert(1<=b and b<=n); assert(1<=c and c<=1000000000); assert(a idset; rep(_, k){ int i; cin>> i; assert(1<=i and i<=m); auto r=idset.insert(i).second; assert(r==true); } assert((int)idset.size()==k); cout<< -1<< endl; return 0; }