#include <bits/stdc++.h>
using namespace std;
int n, m, u, v, d[200000], ok[200000], h[200000], f[200000], ans, root,
    sl[200000], sum, nh;
vector<int> a[200000];
vector<pair<int, int> > vc;
void lui(int u, int p) {
  sl[u] = ok[u];
  for (int j = (0); j <= (a[u].size() - 1); ++j) {
    int v = a[u][j];
    if (v == p) continue;
    lui(v, u);
    sl[u] += sl[v];
  }
}
int get(int u, int p, int k) {
  for (int j = (0); j <= (a[u].size() - 1); ++j) {
    int v = a[u][j];
    if (v == p) continue;
    if (sl[v] > k / 2) return get(v, u, k);
  }
  return u;
}
void dfs(int u, int p) {
  if (ok[u]) {
    if (sum == h[u]) nh = min(nh, u);
    if (sum < h[u]) sum = h[u], nh = u;
    f[u] = 1;
  }
  for (int j = (0); j <= (a[u].size() - 1); ++j) {
    int v = a[u][j];
    if (v == p) continue;
    h[v] = h[u] + 1;
    dfs(v, u);
    f[u] = max(f[u], f[v]);
  }
  if (f[u]) ans += 2;
}
int main() {
  cin >> n >> m;
  for (int i = (1); i <= (n - 1); ++i) {
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  for (int i = (1); i <= (m); ++i) {
    cin >> u;
    ok[u] = 1;
  }
  if (m == 1) {
    cout << u << "\n" << 0;
    return 0;
  }
  lui(u, 0);
  root = get(u, 0, sl[u]);
  for (int j = (0); j <= (a[root].size() - 1); ++j) {
    sum = 0;
    nh = -1;
    h[a[root][j]] = 1;
    dfs(a[root][j], root);
    if (sum > 0) vc.push_back(pair<int, int>(-sum, nh));
  }
  if (vc.size() == 1) {
    cout << min(vc[0].second, root) << "\n" << ans + vc[0].first;
    return 0;
  }
  sort(vc.begin(), vc.end());
  cout << min(vc[0].second, vc[1].second) << "\n"
       << ans + vc[0].first + vc[1].first;
  return 0;
}
