#include <stdio.h>
#include <map>
#include <vector>
#include <set>
#define min(a,b) ( a < b ? a : b)
#define maxval 9999999
#define FOR(i,n) for(int i=0;i<n;i++)

struct Edge {
       int u,w;
       Edge() {}
       Edge(int _u,int _w) {
            u = _u;
            w = _w;
       }
};
struct Graph {
       /*
       int v;
       Graph() { }
       Graph(int _v) {
                 v = _v;
       }
       */
       std::vector<Edge> es;
};
std::vector<Graph> A;
int n,k;
//std::set<int> s;
std::map<int,int> m;
std::map<int,int> m2;
int br=0;

void init() {
     scanf("%d %d",&n,&k);
     int a,b,weight;
     FOR(i,n-1) {
              scanf("%d %d %d",&a,&b,&weight);
              a--; b--;
              A[a].es.push_back(Edge(b,weight));
              A[b].es.push_back(Edge(a,weight));
              
              if(m2.find(a) == m2.end()) {
                m2[a] = ++br;
              }
              if(m2.find(b) == m2.end()) {
                m2[b] = ++br;
              }
     }
     int tmp;
     FOR(i,k) {
              scanf("%d",&tmp);
              //printf("%d",tmp);
              m[tmp-1] = -1;
              //printf("%d",m[tmp]);
     }
     std::map<int,int>::iterator it;
     int cnt = 0;
     for(it = m.begin(); it != m.end(); ++it) {
         //printf("m[] = %d %d",(*it).first,(*it).second);
         if((*it).second == -1) {
            //printf("%d",(*it).first);
            cnt = 0;
            int el = m2[(*it).first];
            std::map<int,int>::iterator f;
            for(f=m2.begin(); f != m2.end(); ++f) {
                if(m[(*f).first] != 0 && (*f).second < el) {
                  cnt++;
                }
            }
           // (*it).second = cnt+1;
            m[(*it).first] = cnt + 1;
         }
     }
//     for(it = m.begin(); it != m.end(); ++it) {
//         printf("%d %d\n",(*it).first,(*it).second);
//     }
}
bool check(int a,int b) {
     FOR(i,A[a].es.size()) if(A[a].es[i].u == b) return true;
     return false;
}
int toInt(int a,int b) {
    FOR(i,A[a].es.size()) if(A[a].es[i].u == b) return A[a].es[i].w;
}
void dijkstra(int s) {
     std::vector<bool> T(n,1);
     T[s] = 0;
     std::vector<int> d(n,maxval);
//     d.resize(n,maxval);
     FOR(i,A[s].es.size()) {
//         int cur = A[s].es[i].u;
         d[A[s].es[i].u] =A[s].es[i].w;
     }
     d[s] = 0;
     while(1) {
          int di = maxval;
          int pred = -1;
          FOR(i,n) if(T[i] && d[i] < di) {
             di = d[i];
             pred = i;
          }
          if(pred == -1) break;
          T[pred] = 0;
          FOR(i,n) if(T[i] && check(pred,i)) {
              d[i] = min(d[i],d[pred] + toInt(pred,i));
          }
     }
     int maxxx = maxval;
     int before = -1;
//     printf("%d\n",s+1);
//     FOR(i,d.size()) printf("%d %d\n",i+1,d[i]);
     FOR(i,d.size()) if(m[i] != 0 && s != i) {
           if(d[i] < maxxx) {
              //d[i] = maxxx;
              maxxx = d[i];
              before = m[i];
           }
           else if(d[i] == maxxx && before > m[i]) {
              before = m[i];
           }
     }
     printf("%d %d\n",before,maxxx);
}
void solve() {
     init();
     FOR(i,n) {
         dijkstra(i);
     }
}
int main() {
    solve();
    return 0;
}
