#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MXN = 200100;
vector<int> adj[MXN];
bool ispink[MXN];
bool vis[MXN];
int cnt[MXN];
vector<int> children[MXN];
void dfs(int v) {
  vis[v] = 1;
  for (auto u : adj[v]) {
    if (vis[u]) continue;
    children[v].push_back(u);
    dfs(u);
    cnt[v] += cnt[u];
  }
  if (ispink[v]) cnt[v]++;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<int> C;
  for (int i = 0; i < k + k; i++) {
    int c;
    cin >> c;
    ispink[c] = 1;
    C.push_back(c);
  }
  dfs(1);
  int v = 1;
  while (1) {
    bool switcheroo = 0;
    for (auto u : children[v]) {
      if (cnt[u] > k) {
        v = u;
        switcheroo = 1;
        break;
      }
    }
    if (!switcheroo) break;
  }
  vector<vector<int>> V(n + 1);
  vector<bool> marked(n + 1);
  priority_queue<pair<int, int>> PQ;
  for (auto u : children[v]) {
    vector<int> BFS = {u};
    while (!BFS.empty()) {
      vector<int> new_BFS;
      for (auto w : BFS) {
        if (ispink[w]) {
          V[u].push_back(w);
          marked[w] = 1;
        }
        for (auto y : children[w]) {
          new_BFS.push_back(y);
        }
      }
      BFS = new_BFS;
    }
    if (int((V[u]).size()) > 0) PQ.push({int((V[u]).size()), u});
  }
  for (auto c : C) {
    if (!marked[c]) V[v].push_back(c);
  }
  if (int((V[v]).size()) > 0) PQ.push({int((V[v]).size()), v});
  cout << 1 << endl;
  cout << v << endl;
  while (!PQ.empty()) {
    auto pq1 = PQ.top();
    PQ.pop();
    auto pq2 = PQ.top();
    PQ.pop();
    cout << V[pq1.second].back() << " " << V[pq2.second].back() << " " << v
         << "\n";
    V[pq1.second].pop_back();
    V[pq2.second].pop_back();
    if (pq1.first > 1) PQ.push({pq1.first - 1, pq1.second});
    if (pq2.first > 1) PQ.push({pq2.first - 1, pq2.second});
  }
}
