#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
int N, K;
int isTeam[200005];
int cnt[200005];
vector<int> ss;
vector<vector<int> > G;
void calcCnt(int now, int parent) {
  if (isTeam[now]) ss.push_back(now);
  for (int i = 0; i < G[now].size(); i++) {
    if (G[now][i] != parent) {
      calcCnt(G[now][i], now);
      cnt[now] += cnt[G[now][i]];
    }
  }
}
int getAns(int now, int parent) {
  for (int i = 0; i < G[now].size(); i++) {
    if (G[now][i] != parent && cnt[G[now][i]] > K) {
      return getAns(G[now][i], now);
    }
  }
  return now;
}
int main() {
  scanf("%d%d", &N, &K);
  G.resize(N + 5);
  int a, b;
  for (int i = 1; i < N; i++) {
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 0; i < 2 * K; i++) {
    scanf("%d", &a);
    isTeam[a] = 1;
    cnt[a] = 1;
  }
  calcCnt(1, 0);
  int ans = getAns(1, 0);
  printf("%d\n%d\n", 1, ans);
  for (int i = 0; i < K; i++) {
    printf("%d %d %d\n", ss[i], ss[i + K], ans);
  }
  return 0;
}
