#include <bits/stdc++.h>
using namespace std;
int n, q, head[130000], _edge, ans, fa[130000], son[130000], bro[130000],
    deep[130000], num[130000], h_son[130000], top[130000], dfsx[130000], _dfsx,
    vfa[130000], vson[130000], vbro[130000], node[130000], root;
bitset<130000> vis;
struct EDGE {
  int a, b, next;
  EDGE(int a = 0, int b = 0, int next = 0) : a(a), b(b), next(next) {}
} edge[2 * 130000];
bool cmp(int a, int b) { return dfsx[a] < dfsx[b]; }
void adde(int a, int b) {
  edge[++_edge] = EDGE(a, b, head[a]);
  head[a] = _edge;
}
void addt(int a, int b) {
  bro[b] = son[a];
  son[a] = b;
  fa[b] = a;
}
void vaddt(int a, int b) {
  ans += deep[b] - deep[a];
  vbro[b] = vson[a];
  vson[a] = b;
  vfa[b] = a;
}
void read() {
  int ls1, ls2;
  scanf("%d%d", &n, &q);
  for (int i = 1; i < n; ++i)
    scanf("%d%d", &ls1, &ls2), adde(ls1, ls2), adde(ls2, ls1);
  return;
}
void dfs1(int a, int c) {
  deep[a] = c;
  for (int i = head[a]; i; i = edge[i].next) {
    int b = edge[i].b;
    if (fa[a] == b) continue;
    addt(a, b);
    dfs1(b, c + 1);
    num[a] += num[b];
    if (num[h_son[a]] < num[b]) h_son[a] = b;
  }
  ++num[a];
}
void dfs2(int a, int t) {
  dfsx[a] = ++_dfsx;
  top[a] = t;
  if (h_son[a]) dfs2(h_son[a], t);
  for (int b = son[a]; b; b = bro[b])
    if (b != h_son[a]) dfs2(b, b);
}
void vdfs(int a, int v, int &ans_node, int &ans_v) {
  if (!a || vis[a]) return;
  vis[a] = 1;
  if (v > ans_v) ans_node = a, ans_v = v;
  if (v == ans_v && ans_node > a) ans_node = a;
  for (int b = vson[a]; b; b = vbro[b]) {
    vdfs(b, v + deep[b] - deep[a], ans_node, ans_v);
  }
  vdfs(vfa[a], v + deep[a] - deep[vfa[a]], ans_node, ans_v);
}
int LCA(int a, int b) {
  while (top[a] != top[b]) {
    if (deep[top[b]] < deep[top[a]]) swap(a, b);
    b = fa[top[b]];
  }
  return deep[a] < deep[b] ? a : b;
}
void vbuild() {
  sort(node + 1, node + 1 + q, cmp);
  deque<int> sta;
  sta.push_back(node[1]);
  for (int i = 2; i <= q; ++i) {
    int lca = LCA(sta.back(), node[i]);
    while (deep[sta.back()] > deep[lca]) {
      int b = sta.back();
      sta.pop_back();
      if (sta.empty() || deep[sta.back()] < deep[lca]) sta.push_back(lca);
      vaddt(sta.back(), b);
    }
    sta.push_back(node[i]);
  }
  while (sta.size() > 1) {
    int b = sta.back();
    sta.pop_back();
    vaddt(sta.back(), b);
  }
  root = sta.back();
}
int main() {
  int ls1 = 0, ls2 = -1;
  read();
  dfs1(1, 0);
  dfs2(1, 1);
  for (int i = 1; i <= q; ++i) scanf("%d", node + i);
  vbuild();
  vdfs(root, 0, ls1, ls2);
  root = 1e6;
  vis = 0;
  vdfs(ls1, 0, root, ls2);
  printf("%d\n%d\n", min(root, ls1), 2 * ans - ls2);
  return 0;
}
