#include <bits/stdc++.h>
using namespace std;
vector<int> e[401];
int id[401][401], dp[401][401];
int p[401][401][401];
int n, k, f[401];
void dfs(int u, int pre) {
  f[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]++;
      p[u][v][j] = 0;
      for (int k = 0; k <= j; k++)
        if (dp[u][j] >= dp[v][k] + dp[u][j - k]) {
          dp[u][j] = dp[v][k] + dp[u][j - k];
          p[u][v][j] = k;
        }
    }
  }
  return;
}
void print(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 (p[u][v][k] == 0)
      cout << id[u][v] << endl;
    else {
      print(v, p[u][v][k], u);
      k -= p[u][v][k];
    }
  }
  return;
}
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][f[root]] << endl;
  print(root, k, f[root]);
  return 0;
}
