#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int N = 410;
int f[N][N], tmp[N];
bitset<N> g[N][N], tmp2[N];
vector<int> v[N];
struct Edge {
  int x, y, t;
} e[N];
int n, k, x, y, ans, fa2;
pair<int, int> ans1;
void dfs(int x, int fa) {
  f[x][0] = f[x][1] = 0;
  int t;
  for (int i = 0; i < v[x].size(); i++)
    if ((x ^ e[v[x][i]].x ^ e[v[x][i]].y) != fa) {
      t = x ^ e[v[x][i]].x ^ e[v[x][i]].y;
      dfs(t, x);
      for (int j = 1; j <= k; j++) tmp[j] = INF, tmp2[j].reset();
      for (int j = 1; j <= k; j++) {
        if (f[x][j] + 1 < tmp[j]) {
          tmp[j] = f[x][j] + 1;
          tmp2[j] = g[x][j];
          tmp2[j].set(e[v[x][i]].t);
        }
        for (int p = 1; p < j; p++)
          if (f[x][j - p] + f[t][p] < tmp[j]) {
            tmp[j] = f[x][j - p] + f[t][p];
            tmp2[j] = g[x][j - p] | g[t][p];
          }
      }
      memcpy(f[x], tmp, sizeof(f[x]));
      for (int j = 1; j <= k; j++) g[x][j] = tmp2[j];
    }
  if (x != 1) {
    if (f[x][k] + 1 < ans) {
      ans = f[x][k] + 1;
      ans1 = make_pair(x, k);
      fa2 = fa;
    }
  } else {
    if (f[x][k] < ans) {
      ans = f[x][k];
      ans1 = make_pair(x, k);
    }
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    e[i].x = x, e[i].y = y, e[i].t = i;
    v[x].push_back(i), v[y].push_back(i);
  }
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++) f[i][j] = INF;
  ans = INF;
  dfs(1, 0);
  cout << ans << endl;
  if (ans) {
    for (int i = 0; i < n; i++)
      if (g[ans1.first][ans1.second][i] == 1) cout << i << ' ';
    if (ans1.first != 1) {
      for (int i = 1; i < n; i++)
        if ((ans1.first == e[i].x && fa2 == e[i].y) ||
            (ans1.first == e[i].y && fa2 == e[i].x))
          cout << i;
    }
    cout << endl;
  }
  return 0;
}
