#include <bits/stdc++.h>
using namespace std;
const int MAXN = 405;
const int oo = 10005;
int N, M, T, K, Q;
vector<pair<int, int> > G[MAXN];
int par[MAXN];
int indPar[MAXN];
bool minimize(int &x, const int &y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
void DFS(int u, int p) {
  par[u] = p;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i].first;
    if (v != p) {
      indPar[v] = G[u][i].second;
      DFS(v, u);
    }
  }
  return;
}
namespace Bottom_up_Solution {
int dp[MAXN][MAXN];
int numChild[MAXN];
int choose[MAXN];
map<pair<int, int>, int> MP[MAXN];
int F[MAXN];
void DFS(int u, int pa) {
  dp[u][0] = 1;
  dp[u][1] = 0;
  for (auto p : G[u]) {
    int v = p.first;
    if (v == pa) continue;
    DFS(v, u);
    memset(F, 0x3f, (N + 2) * sizeof(int));
    for (int k = 1; k <= N; k++)
      for (int j = 0; j <= N - k; j++)
        if (minimize(F[k + j], dp[u][k] + dp[v][j]))
          MP[k + j][make_pair(u, v)] = j;
    for (int k = 1; k <= N; k++) dp[u][k] = F[k];
  }
}
void TRACE(int u, int re) {
  choose[u] = 1;
  if (G[u].size() == 0) return;
  for (int i = G[u].size() - 1; i >= 0; i--) {
    int v = G[u][i].first;
    if (v == par[u]) continue;
    int j = MP[re][make_pair(u, v)];
    if (j) TRACE(v, j);
    re -= j;
  }
}
void SOLVE() {
  memset(dp, 0x3f, sizeof(dp));
  memset(choose, 0, sizeof(choose));
  DFS(1, 0);
  int ANS = dp[1][K];
  int ansI = 1;
  for (int i = 2; i <= N; i++)
    if (dp[i][K] + 1 < ANS) {
      ANS = dp[i][K] + 1;
      ansI = i;
    }
  cout << ANS << '\n';
  cerr << ansI << '\n';
  TRACE(ansI, K);
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < G[i].size(); j++) {
      int v = G[i][j].first;
      if (choose[i] == 0 && choose[v]) cout << G[i][j].second << ' ';
    }
  }
}
}  // namespace Bottom_up_Solution
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (fopen("440D"
            ".inp",
            "r")) {
    freopen(
        "440D"
        ".inp",
        "r", stdin);
    freopen(
        "440D"
        ".out",
        "w", stdout);
  }
  cin >> N >> K;
  int u, v;
  for (int i = 1; i <= N - 1; i++) {
    cin >> u >> v;
    G[u].push_back({v, i});
    G[v].push_back({u, i});
  }
  DFS(1, 0);
  Bottom_up_Solution ::SOLVE();
}
