#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007 /5;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-10;
const long double epsA=1e-4;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}


bool solve(int ca){
	int n,t,k,i,j,ans=0;cin>>n>>t>>k;
	if(n==0){return false;}
	cout<<"Case "<<ca<<": ";
	vector<vector<int>>go(n);
	vector<int>gowa(n);//行き先の残り和
	vector<int>zi(n);//残り次数
	vector<tuple<int,int,int>>edges(n-1);
	vector<tuple<int,int,int>>zyo(n-1);
	vector<bool>kie(n-1);
	for(i=0;i<n-1;i++){
		int a,b,c;cin>>a>>b>>c;a--;b--;
		if(a>b){swap(a,b);}
		edges[i]=mt(c,a,b);
		zyo[i]=mt(a,b,c);
		go[a].pub(b);gowa[a]+=b;zi[a]++;
		go[b].pub(a);gowa[b]+=a;zi[b]++;
	}
	SO(edges);
	for(i=0;i<n-1;i++){
		int a,b,c;tie(c,a,b)=edges[i];
		zyo[i]=mt(a,b,i);
	}
	SO(zyo);
	vector<bool>nobe(n,true);//baseの否定
	for(i=0;i<t;i++){
		int a;cin>>a;a--;
		nobe[a]=false;
	}
	stack<int>eraque;
	for(i=0;i<n;i++){
		if(nobe[i]&&zi[i]==1){eraque.push(i);}
	}
	int bas=0;
	while(k--){
		while(eraque.size()){
			int ter=eraque.top();
			
			eraque.pop();
			if(zi[ter]!=1){continue;}
			
			int it=gowa[ter];
			//cerr<<"eter="<<ter<<"it="<<it<<endl;
			zi[ter]--;
			zi[it]--;
			gowa[it]-=ter;
			if(nobe[it]&&zi[it]==1){eraque.push(it);}
			if(ter>it){swap(ter,it);}
			int ban=get<2>(*lower_bound(zyo.begin(),zyo.end(),mt(ter,it,-1)));
			//cerr<<"ban="<<ban<<endl;
			kie[ban]=1;//この辺は消えた!
		}
		while(kie[bas]){bas++;}
		int c,a,b;tie(c,a,b)=edges[bas];
		ans+=c;
		zi[a]--;gowa[a]-=b;
		if(nobe[a]&&zi[a]==1){eraque.push(a);}
		zi[b]--;gowa[b]-=a;
		if(nobe[b]&&zi[b]==1){eraque.push(b);}
		
		bas++;
		
	}
	cout<<ans<<endl;
	return true;
}
/*
4 3 2
1 2 3
2 3 4
3 4 10
1
3
4
*/
int main(void){
	cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);
	int ca=1;
	while(solve(ca)){ca++;}
	return 0;
}


Measured memory_bytes: 3888