#include <bits/stdc++.h>
using namespace std;
const int MAX = 123456 + 5;
vector<int> adj[MAX];
int cnt[MAX];
int att[MAX];
int vis[MAX], visID;
void build(int src, int p) {
  cnt[src] = att[src];
  for (int i = 0; i < adj[src].size(); i++) {
    int t = adj[src][i];
    if (t == p) continue;
    build(t, src);
    cnt[src] += cnt[t];
  }
}
int furthest(int src) {
  visID++;
  queue<int> q;
  q.push(src);
  int mn = MAX;
  vis[src] = visID;
  while (q.size()) {
    int s = q.size();
    int best = MAX;
    while (s--) {
      int cur = q.front();
      q.pop();
      if (att[cur] && cur < best) best = cur;
      for (int i = 0; i < adj[cur].size(); i++) {
        int t = adj[cur][i];
        if (vis[t] == visID) continue;
        q.push(t);
        vis[t] = visID;
      }
    }
    if (best != MAX) mn = best;
  }
  return mn;
}
pair<long long, long long> dfs(int src, int p) {
  if (cnt[src] - att[src] == 0) return make_pair(0, 0);
  long long sum = 0, mx = 0;
  for (int i = 0; i < adj[src].size(); i++) {
    int t = adj[src][i];
    if (t == p || cnt[t] == 0) continue;
    pair<long long, long long> temp = dfs(t, src);
    temp.first++, temp.second++;
    mx = max(mx, temp.second);
    sum += temp.first + temp.second;
  }
  return make_pair(sum - mx, mx);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    att[x] = 1;
  }
  int beg = furthest(1);
  beg = min(beg, furthest(beg));
  build(beg, -1);
  cout << beg << "\n" << dfs(beg, -1).first << "\n";
  return 0;
}
