#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
vector<vector<int>> graph, vv(maxn);
vector<bool> u;
vector<int> kk;
int DFS1(int s, int p) {
  if (u[s]) kk[s] = 1;
  for (int to : graph[s]) {
    if (to == p) continue;
    kk[s] += DFS1(to, s);
  }
  return kk[s];
}
void DFS3(int s, int p, int cur) {
  if (u[s]) vv[cur].push_back(s);
  for (int to : graph[s]) {
    if (to == p) continue;
    DFS3(to, s, cur);
  }
}
void DFS2(int s, int p) {
  int maxk = -1e9, maxi, k = kk[0] / 2;
  for (int to : graph[s]) {
    if (to == p) continue;
    if (kk[to] > maxk) {
      maxk = kk[to];
      maxi = to;
    }
  }
  if (maxk > k)
    DFS2(maxi, s);
  else {
    printf("%d\n%d\n", 1, s + 1);
    int cur = 0;
    set<pair<int, int>> ss;
    for (int to : graph[s]) {
      DFS3(to, s, cur);
      if (vv[cur].size()) {
        ss.insert({vv[cur].size(), cur});
        cur++;
      }
    }
    if (u[s]) {
      vv[cur].push_back(s);
      ss.insert({vv[cur].size(), cur});
      cur++;
    }
    while (!ss.empty()) {
      auto it = ss.end();
      it--;
      auto c1 = *it;
      it--;
      auto c2 = *it;
      ss.erase(c1);
      ss.erase(c2);
      int k1 = c1.second, k2 = c2.second;
      printf("%d %d %d\n", vv[k1].back() + 1, vv[k2].back() + 1, s + 1);
      vv[k1].pop_back();
      vv[k2].pop_back();
      if (vv[k1].size()) ss.insert({vv[k1].size(), k1});
      if (vv[k2].size()) ss.insert({vv[k2].size(), k2});
    }
  }
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  graph.resize(n);
  u.resize(n);
  kk.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  for (int i = 0; i < 2 * k; i++) {
    int a;
    scanf("%d", &a);
    a--;
    u[a] = 1;
  }
  DFS1(0, -1);
  DFS2(0, -1);
}
