#include <bits/stdc++.h>
using namespace std;
int f[401][401], n, K;
int fa[401], siz[401], son[401];
vector<int> a[401];
int pre[401][401][401], ans[401];
int opt[2][401];
int head[401], ver[810], nex[810], tot = 1;
void add(int x, int y) {
  ver[++tot] = y;
  nex[tot] = head[x];
  head[x] = tot;
}
void dp(int x) {
  int i, j, k, y, cnt;
  siz[x] = 1;
  for (i = head[x]; i; i = nex[i])
    if (fa[x] != i)
      son[x]++, a[x].push_back(i), fa[y = ver[i]] = i ^ 1, dp(y),
                                          siz[x] += siz[y];
  f[x][0] = 1;
  f[x][siz[x]] = 0;
  memset(opt[0], 0x3f, sizeof(opt[0]));
  opt[0][1] = 0;
  for (cnt = 0, i = head[x]; i; i = nex[i])
    if (i != fa[x]) {
      y = ver[i];
      cnt++;
      memset(opt[cnt & 1], 0x3f, sizeof(opt[cnt & 1]));
      for (j = 1; j <= siz[x]; j++)
        for (k = 0; k <= siz[ver[i]] && k <= j; k++)
          if (opt[(cnt - 1) & 1][j - k] + f[y][k] < opt[cnt & 1][j])
            opt[cnt & 1][j] = opt[(cnt - 1) & 1][j - k] + f[y][k],
                      pre[x][cnt][j] = k;
    }
  f[x][0] = 1;
  for (i = 1; i <= siz[x]; i++) f[x][i] = opt[cnt & 1][i];
  return;
}
void dfs(int x, int cnt, int num) {
  if (cnt == 0) return;
  if (pre[x][cnt][num] == 0)
    ans[++ans[0]] = a[x][cnt - 1] / 2, dfs(x, cnt - 1, num);
  else
    dfs(x, cnt - 1, num - pre[x][cnt][num]),
        dfs(ver[a[x][cnt - 1]], son[ver[a[x][cnt - 1]]], pre[x][cnt][num]);
}
int main() {
  int i, j, k, ANS;
  cin >> n >> K;
  memset(f, 0x3f, sizeof(f));
  for (i = 1; i < n; i++) scanf("%d%d", &j, &k), add(j, k), add(k, j);
  dp(1);
  ANS = f[1][K];
  for (i = 2; i <= n; i++) ANS = min(f[i][K] + 1, ANS);
  cout << ANS << endl;
  for (i = 2; i <= n; i++)
    if (ANS == f[i][K] + 1) break;
  if (i > n)
    i = 1;
  else
    ans[++ans[0]] = fa[i] / 2;
  dfs(i, son[i], K);
  sort(ans + 1, ans + ans[0] + 1);
  for (i = 1; i <= ans[0]; i++) cout << ans[i] << ' ';
  return 0;
}
