#include <bits/stdc++.h>
class Node {
 private:
  std::list<Node *> edges;
  int id;
  bool humans;

 public:
  Node(int id);
  void placeHumans() { humans = true; }
  bool containsHumans() { return humans; }
  bool isLeaf() { return edges.size() <= 1; }
  int getId() { return id; }
  void addEdge(Node *node);
  void pruneEmptyLeaves(Node *parent);
  void distanceBetweenTwoDeepestLeaves(int *max_depth, int *deepest_leaf_id,
                                       int *distance_between_deepest,
                                       int *leaf1, int *leaf2, Node *parent);
  int traverseLength(Node *parent);
};
Node::Node(int id) {
  this->id = id;
  humans = false;
}
void Node::addEdge(Node *node) { edges.push_back(node); }
static int min(int a, int b) { return (a < b) ? a : b; }
static int max(int a, int b) { return (a > b) ? a : b; }
void Node::distanceBetweenTwoDeepestLeaves(int *max_depth_r,
                                           int *deepest_leaf_id_r,
                                           int *distance_between_deepest_r,
                                           int *leaf1_r, int *leaf2_r,
                                           Node *parent) {
  if ((parent && this->isLeaf()) || edges.size() == 0) {
    *max_depth_r = 0;
    *deepest_leaf_id_r = id;
    *distance_between_deepest_r = 0;
    *leaf1_r = *leaf2_r = id;
  } else {
    int max_depths[2];
    int deepest_leaves[2];
    int num_deep_leaves = 0;
    int max_dist = INT_MIN;
    int max_dist_leaf1 = -1, max_dist_leaf2 = -1;
    for (std::list<Node *>::iterator it = edges.begin(); it != edges.end();
         ++it) {
      int max_depth, deepest_leaf_id, distance_between_deepest, leaf1, leaf2;
      if (parent && (*it)->getId() == parent->getId()) continue;
      (*it)->distanceBetweenTwoDeepestLeaves(&max_depth, &deepest_leaf_id,
                                             &distance_between_deepest, &leaf1,
                                             &leaf2, this);
      if (distance_between_deepest > max_dist ||
          (distance_between_deepest == max_dist &&
           min(leaf1, leaf2) < min(max_dist_leaf1, max_dist_leaf2))) {
        max_dist = distance_between_deepest;
        if (leaf1 > leaf2) {
          std::swap(leaf1, leaf2);
        }
        max_dist_leaf1 = leaf1;
        max_dist_leaf2 = leaf2;
      }
      int insert_pos;
      max_depth++;
      for (insert_pos = 0; insert_pos < num_deep_leaves; ++insert_pos) {
        if (max_depth > max_depths[insert_pos] ||
            (max_depth == max_depths[insert_pos] &&
             deepest_leaf_id < deepest_leaves[insert_pos]))
          break;
      }
      if (insert_pos < 2) {
        memmove(max_depths + insert_pos + 1, max_depths + insert_pos,
                sizeof(int) * (1 - insert_pos));
        memmove(deepest_leaves + insert_pos + 1, deepest_leaves + insert_pos,
                sizeof(int) * (1 - insert_pos));
        max_depths[insert_pos] = max_depth;
        deepest_leaves[insert_pos] = deepest_leaf_id;
        if (num_deep_leaves < 2) num_deep_leaves++;
      }
    }
    int depth_sum = 0;
    for (int i = 0; i < num_deep_leaves; ++i) {
      depth_sum += max_depths[i];
    }
    if (num_deep_leaves == 2 &&
        (depth_sum > max_dist ||
         (depth_sum == max_dist && min(deepest_leaves[0], deepest_leaves[1]) <
                                       min(max_dist_leaf1, max_dist_leaf2)))) {
      *max_depth_r = max_depths[0];
      *deepest_leaf_id_r = deepest_leaves[0];
      *distance_between_deepest_r = depth_sum;
      *leaf1_r = deepest_leaves[0];
      *leaf2_r = deepest_leaves[1];
    } else {
      if (!parent && isLeaf() &&
          (max_depths[0] > max_dist ||
           (max_depths[0] == max_dist &&
            (this->id < min(max_dist_leaf1, max_dist_leaf2) ||
             deepest_leaves[0] < min(max_dist_leaf1, max_dist_leaf2))))) {
        *max_depth_r = max_depths[0];
        *deepest_leaf_id_r = deepest_leaves[0];
        *distance_between_deepest_r = max_depths[0];
        *leaf1_r = min(this->id, deepest_leaves[0]);
        *leaf2_r = max(this->id, deepest_leaves[0]);
      } else {
        *max_depth_r = max_depths[0];
        *deepest_leaf_id_r = deepest_leaves[0];
        *distance_between_deepest_r = max_dist;
        *leaf1_r = max_dist_leaf1;
        *leaf2_r = max_dist_leaf2;
      }
    }
  }
}
int Node::traverseLength(Node *parent) {
  int total = 0;
  for (std::list<Node *>::iterator it = edges.begin(); it != edges.end();
       ++it) {
    if (parent && (*it)->getId() == parent->getId()) continue;
    total += 2 + (*it)->traverseLength(this);
  }
  return total;
}
void Node::pruneEmptyLeaves(Node *parent) {
  std::list<Node *> new_edges;
  for (std::list<Node *>::iterator it = edges.begin(); it != edges.end();
       ++it) {
    bool keep = true;
    if (!(parent && (*it)->getId() == parent->getId())) {
      (*it)->pruneEmptyLeaves(this);
      if ((*it)->isLeaf()) {
        if (!(*it)->containsHumans()) {
          keep = false;
        }
      }
    }
    if (keep) new_edges.push_back(*it);
  }
  edges = new_edges;
}
int main(int argc, char **argv) {
  int num_cities, num_cities_attacked;
  std::vector<Node *> tree;
  std::cin >> num_cities >> num_cities_attacked;
  for (int i = 0; i < num_cities; ++i) {
    tree.push_back(new Node(i + 1));
  }
  for (int i = 0; i < num_cities - 1; ++i) {
    int node1, node2;
    std::cin >> node1 >> node2;
    tree[node1 - 1]->addEdge(tree[node2 - 1]);
    tree[node2 - 1]->addEdge(tree[node1 - 1]);
  }
  int root = -1;
  for (int i = 0; i < num_cities_attacked; ++i) {
    int node;
    std::cin >> node;
    tree[node - 1]->placeHumans();
    if (root < 0) root = node;
  }
  Node *root_node = tree[root - 1];
  root_node->pruneEmptyLeaves(NULL);
  int trav_len = root_node->traverseLength(NULL);
  int max_depth = 0;
  int deepest_leaf_id = -1;
  int distance_between_deepest = -1;
  int leaf1 = -1, leaf2 = -1;
  root_node->distanceBetweenTwoDeepestLeaves(&max_depth, &deepest_leaf_id,
                                             &distance_between_deepest, &leaf1,
                                             &leaf2, NULL);
  int shortest_path = trav_len - distance_between_deepest;
  int start_leaf = leaf1;
  if (leaf1 > leaf2) start_leaf = leaf2;
  std::cout << start_leaf << std::endl << shortest_path << std::endl;
  for (int i = 0; i < tree.size(); ++i) delete tree[i];
  return 0;
}
