#include <bits/stdc++.h>
using namespace std;
const int Maxn = 400010;
long long n, m, u, v, head[Maxn << 2], tot, cnt[Maxn << 2];
long long line[Maxn];
struct Edge {
  long long to, w, nxt;
} edge[Maxn << 2];
inline void add(long long u, long long v) {
  tot++;
  edge[tot].to = v;
  edge[tot].nxt = head[u];
  head[u] = tot;
}
bool mark[Maxn << 2];
inline void dfs1(long long x, long long fa) {
  cnt[x] = mark[x];
  for (long long i = head[x]; i; i = edge[i].nxt) {
    long long tmp = edge[i].to;
    if (tmp == fa) continue;
    dfs1(tmp, x);
    cnt[x] += cnt[tmp];
  }
}
pair<long long, long long> ans;
long long Total;
inline bool longest(long long x, long long fa, long long dep) {
  if (mark[x]) {
    if (make_pair(dep, -x) > ans) ans = make_pair(dep, -x);
  }
  bool has = mark[x];
  for (long long i = head[x]; i; i = edge[i].nxt) {
    long long tmp = edge[i].to;
    if (tmp == fa) continue;
    long long temp = longest(tmp, x, dep + 1);
    has |= temp;
    Total += temp;
  }
  return has;
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i < n; i++) {
    scanf("%lld%lld", &u, &v);
    add(u, v);
    add(v, u);
  }
  for (long long i = 1; i <= m; i++)
    scanf("%lld", &line[i]), mark[line[i]] = true;
  dfs1(1, 0);
  sort(line + 1, line + m + 1);
  long long start = line[1];
  if (m == 1) {
    printf("%lld\n0\n", line[1]);
    return 0;
  }
  longest(start, 0, 0);
  long long res1 = -ans.second, res2 = Total;
  ans = make_pair(0, 0);
  longest(res1, 0, 0);
  long long count;
  if (res1 < (-ans.second))
    count = res1;
  else
    count = -ans.second;
  printf("%lld\n%lld\n", count, (res2 << 1) - ans.first);
  return 0;
}
