#include <bits/stdc++.h>
using namespace std;
const int N = 405;
vector<int> e[N];
int n, k, father[N];
int dp[N][N], path[N][N][N], id[N][N];
void dfs(int u, int pre) {
  father[u] = pre;
  dp[u][1] = 0;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    if (v == pre) continue;
    dfs(v, u);
    for (int j = n; j >= 0; j--) {
      dp[u][j]++;
      path[u][v][j] = 0;
      for (int k = 0; k <= j; k++) {
        if (dp[u][j] >= dp[u][j - k] + dp[v][k]) {
          dp[u][j] = dp[u][j - k] + dp[v][k];
          path[u][v][j] = k;
        }
      }
    }
  }
}
void out(int u, int k, int pre) {
  for (int i = e[u].size() - 1; i >= 0; i--) {
    int v = e[u][i];
    if (v == pre) continue;
    if (path[u][v][k] == 0)
      cout << id[u][v] << endl;
    else {
      out(v, path[u][v][k], u);
      k -= path[u][v][k];
    }
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
    id[u][v] = id[v][u] = i;
  }
  memset(dp, 0x11, sizeof(dp));
  dfs(1, 0);
  int ans = dp[1][k], root = 1;
  for (int i = 2; i <= n; i++) {
    if (dp[i][k] + 1 < ans) {
      ans = dp[i][k] + 1;
      root = i;
    }
  }
  cout << ans << endl;
  if (root != 1) cout << id[root][father[root]] << endl;
  out(root, k, father[root]);
  return 0;
}
