#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
vector<int> edges[N];
vector<int> cities;
bool mark[N];
int cnt[N];
int total;
void dfs(int i, int par = 0) {
  for (int& v : edges[i])
    if (v != par) {
      cnt[v] = cnt[i] + 1;
      dfs(v, i);
    }
}
bool dfs2(int i, int par = 0) {
  bool has_children = false;
  for (int& v : edges[i])
    if (v != par) {
      bool now_has = dfs2(v, i);
      has_children |= now_has;
      if (now_has) ++total;
    }
  return has_children | mark[i];
}
int main() {
  int n, m;
  cin >> n >> m;
  cities.resize(m);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  for (int& city : cities) cin >> city;
  for (int& city : cities) mark[city] = true;
  dfs(cities[0]);
  int max_city = cities[0];
  for (int i = 1; i < m; ++i)
    if (cnt[cities[i]] > cnt[max_city]) max_city = cities[i];
  memset(cnt, 0, sizeof cnt);
  dfs(max_city);
  max_city = cities[0];
  for (int& city : cities)
    if (cnt[city] > cnt[max_city]) max_city = city;
  int dia = cnt[max_city];
  int centre = 0;
  for (int i = 1; i <= n; ++i)
    if (cnt[i] == dia / 2) centre = i;
  memset(cnt, 0, sizeof cnt);
  dfs(centre);
  sort(cities.begin(), cities.end());
  max_city = cities[0];
  for (int i = 1; i < m; ++i)
    if (cnt[cities[i]] > cnt[max_city]) max_city = cities[i];
  int max_city2 = 0;
  memset(cnt, 0, sizeof cnt);
  dfs(max_city);
  max_city2 = cities[0];
  for (int i = 1; i < m; ++i)
    if (cnt[cities[i]] > cnt[max_city2]) max_city2 = cities[i];
  dfs2(cities[0]);
  cout << min(max_city, max_city2) << '\n' << (total - dia) * 2 + dia;
}
