#include <bits/stdc++.h>
using namespace std;
vector<int> s[405], D[405][2][405], out;
int G[405][405], dp[405][2][405], all[405], n, m, ans = -1;
int dfs(int u, int fa) {
  int i, j, k, l, sum = 1, add = 0;
  vector<int> tmp;
  for (i = 0; i < s[u].size(); i++) {
    int v = s[u][i];
    if (v == fa) continue;
    sum += dfs(v, u);
    add++;
    tmp.push_back(v);
  }
  for (i = 0; i <= 1; i++) {
    dp[u][i][0] = 0, dp[u][i][sum] = 1;
    if (fa != -1) D[u][i][sum].push_back(G[u][fa]);
  }
  for (i = 1; i <= tmp.size(); i++) {
    int v = tmp[i - 1];
    for (j = 0; j < 405; j++)
      dp[u][0][j] = dp[u][1][j], D[u][0][j] = D[u][1][j];
    for (j = 1; j < sum; j++) {
      for (k = 1; k <= all[v] && k <= j; k++) {
        if (dp[u][0][j - k] == -1 || dp[v][1][k] == -1) continue;
        if (dp[u][1][j] == -1 || dp[u][0][j - k] + dp[v][1][k] < dp[u][1][j]) {
          dp[u][1][j] = dp[u][0][j - k] + dp[v][1][k];
          D[u][1][j].clear();
          for (l = 0; l < D[u][0][j - k].size(); l++)
            D[u][1][j].push_back(D[u][0][j - k][l]);
          for (l = 0; l < D[v][1][k].size(); l++)
            D[u][1][j].push_back(D[v][1][k][l]);
        }
      }
    }
  }
  if (fa == -1) {
    if (ans == -1 || dp[u][1][n - m] < ans)
      ans = dp[u][1][n - m], out = D[u][1][n - m];
  } else if (sum >= m) {
    if (ans == -1 || dp[u][1][sum - m] + 1 < ans)
      ans = dp[u][1][sum - m] + 1, out = D[u][1][sum - m],
      out.push_back(G[u][fa]);
  }
  return all[u] = sum;
}
int main() {
  int i, j, x, y;
  memset(dp, -1, sizeof(dp));
  scanf("%d%d", &n, &m);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    s[x].push_back(y);
    s[y].push_back(x);
    G[x][y] = G[y][x] = i;
  }
  dfs(1, -1);
  printf("%d\n", ans);
  if (out.size()) printf("%d", out[0]);
  for (i = 1; i < out.size(); i++) printf(" %d", out[i]);
  puts("");
}
