#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;


struct E{
    int node1,node2,wgt;
    E(){
        node1=-1;
        node2=-1;
        wgt=-1;
    }
    E(int a,int b,int c){
        node1=a;
        node2=b;
        wgt=c;
    }
};

bool cmp(E x, E y){
    return x.wgt<y.wgt;
}

map<int,map<int,int>> mp;
vector<E> edge[20000];
E edgelst[20000];
bool ismil[20000];
int n,k,t,par[20000],chl[20000];

int dfs(int cur,int prev){
    int tmp=0,next;
    for(int i=0;i<edge[cur].size();i++){
        next = edge[cur][i].node2;
        if(next==prev)
            continue;
        par[next]=cur;
        tmp+=dfs(next,cur);
    }
    chl[cur]=tmp;
    if(ismil[cur])
        return 1;
    mp[cur][prev]=tmp>0;
    mp[prev][cur]=tmp>0;
    return tmp>0;
}

void reform(int cur,int parent,int Label){
    if(Label<0){
        ///down
        if(!ismil[cur]){
//        printf("(%d %d %d)",cur,parent,Label);
            if(chl[cur]==1){
                int next;
                for(int i=0;i<edge[cur].size();i++){
                    next = edge[cur][i].node2;
                    if(mp[cur][next]==0)
                        continue;
                    mp[cur][next]=0;
                    mp[next][cur]=0;
                    par[next]=0;
                    reform(next,cur,-1);
                    return ;
                }
            }
        }
    }
    else{
        ///up
        if(ismil[parent]==1)
            return;
//        printf("(%d %d %d)",cur,parent,Label);
        if(par[parent]==0){
            if(chl[parent]==1){
                reform(parent,0,-1);
            }
        }
        if(par[parent]!=0&&chl[parent]==0){
            mp[parent][par[parent]]=0;
            mp[par[parent]][parent]=0;
            chl[par[parent]]--;
            reform(parent,par[parent],1);
            //parent = par[parent];
        }
    }
}

int main(){

    int x,y,w,ans,cur=0,c=0,tmp,cnt=1,parent;

    while(true){
        scanf("%d%d%d",&n,&t,&k);
        if(n==0)
            return 0;
        /// RESET
        ans=0;
        cur=0;
        for(int i=0;i<=n;i++){
            par[i]=0;
            chl[i]=0;
            ismil[i]=false;
            edge[i].clear();
            mp.clear();
        }
        /// Begin
        for(int i=0;i<n-1;i++){
            scanf("%d%d%d",&x,&y,&w);
            edge[x].push_back(E(x,y,w));
            edge[y].push_back(E(y,x,w));
            edgelst[i]=E(x,y,w);
            mp[x][y]=1;
            mp[y][x]=1;
        }
        for(int i=0;i<t;i++){
            scanf("%d",&x);
            ismil[x]=true;
            tmp=x;
        }
        sort(edgelst,edgelst+n-1,cmp);
        par[tmp]=0;
        dfs(tmp,0);
//        for(int i=0;i<n-1;i++){
//            printf("%d %d %d\n",edgelst[i].node1,edgelst[i].node2,mp[edgelst[i].node1][edgelst[i].node2]);
//        }
        //printf("%d",edge[0].front().wgt);
        c=0;
        while(k>0&&c<n){
            x = edgelst[c].node1;
            y = edgelst[c].node2;
            w = edgelst[c].wgt;


            if(mp[x][y]==1){
                cur=y; parent=x;
                if(par[x]==y){
                    parent = y;
                    cur=x;
                }
                ans+=w;
                k--;
                mp[cur][parent]=0;
                mp[parent][cur]=0;
                chl[parent]--;
                par[cur]=0;

                reform(cur,parent,-1);
                reform(cur,parent,1);
            }
            c++;
//            else{
//                mp[x][y]=tmp1;
//                mp[y][x]=tmp2;
//            }
        }
        if(k>0)
            ans=-1;
        printf("Case %d: %d\n",cnt,ans);
        cnt++;
    }
}



Measured memory_bytes: 6836