#include <bits/stdc++.h>
using namespace std;
const int N = 405;
vector<int> adj[N];
int dp[N][N];
int id[N][N];
int sz[N];
int temp[N], par[N];
vector<int> baal[N][N], cld[N];
void dfs(int u, int p) {
  sz[u] = 1;
  par[u] = p;
  fill(dp[u], dp[u] + N, N);
  dp[u][1] = 0;
  int d = 0;
  for (int v : adj[u]) {
    if (v == p) continue;
    dfs(v, u);
    fill(temp, temp + N, N);
    vector<int> prv(N, -1);
    for (int i = 0; i <= sz[u]; i++) {
      for (int j = 0; j <= sz[v]; j++) {
        if (temp[i + j] > dp[u][i] + dp[v][j]) {
          temp[i + j] = dp[u][i] + dp[v][j];
          prv[i + j] = j;
        }
      }
    }
    baal[u][++d] = prv;
    for (int i = 0; i < N; i++) dp[u][i] = temp[i];
    sz[u] += sz[v];
    cld[u].push_back(v);
  }
  dp[u][0] = 1;
}
vector<int> bad;
void trace(int u, int p, int k) {
  if (k == 0) {
    bad.push_back(id[u][p]);
    return;
  }
  int cur = cld[u].size(), curk = k;
  while (cur > 0) {
    int take = baal[u][cur][curk];
    trace(cld[u][cur - 1], u, take);
    curk -= take;
    cur--;
  }
  assert(curk == 1);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    id[u][v] = id[v][u] = i;
  }
  dfs(1, -1);
  int ans = N, root = -1;
  for (int i = 1; i <= n; i++) {
    int cur = dp[i][k] + (i > 1);
    if (cur < ans) {
      ans = cur;
      root = i;
    }
  }
  cout << ans << endl;
  if (root > 1) bad.push_back(id[root][par[root]]);
  trace(root, -1, k);
  for (int x : bad) cout << x << " ";
  cout << endl;
}
