#include <bits/stdc++.h>
using namespace std;
const int N = 405;
int n, k, u, v, cnt, check[N], tour[N], child[N], pre[N];
int idx[N][N], dp[N][N], par[N], ans = 1e9, luu;
vector<int> adj[N], trace;
void dfs(int u) {
  tour[cnt] = u;
  cnt--;
  check[u] = child[u] = 1;
  for (int v : adj[u]) {
    if (check[v] == 0) {
      par[v] = u;
      dfs(v);
      child[u] += child[v];
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  if (n == k) {
    cout << "0";
    return 0;
  }
  k = n - k;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
    idx[u][v] = idx[v][u] = i;
  }
  for (int root = 1; root <= n; root++) {
    for (int i = 1; i <= n; i++) {
      check[i] = child[i] = 0;
    }
    cnt = n;
    dfs(root);
    for (int i = 1; i <= n; i++) {
      pre[i] = i - child[tour[i]] + 1;
    }
    for (int i = 0; i <= n; i++) {
      for (int j = 1; j <= k; j++) {
        dp[i][j] = 1e9;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= k; j++) {
        if (j >= child[tour[i]]) {
          dp[i][j] = min(dp[i - 1][j], dp[pre[i] - 1][j - child[tour[i]]] + 1);
        } else {
          dp[i][j] = dp[i - 1][j];
        }
      }
    }
    if (dp[n][k] < ans) {
      ans = dp[n][k];
      luu = root;
    }
  }
  for (int i = 1; i <= n; i++) {
    check[i] = child[i] = 0;
  }
  cnt = n;
  dfs(luu);
  for (int i = 1; i <= n; i++) {
    pre[i] = i - child[tour[i]] + 1;
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      dp[i][j] = 1e9;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      if (j >= child[tour[i]]) {
        dp[i][j] = min(dp[i - 1][j], dp[pre[i] - 1][j - child[tour[i]]] + 1);
      } else {
        dp[i][j] = dp[i - 1][j];
      }
    }
  }
  int dm = n, vl = k;
  while (dm >= 1) {
    if (vl >= child[tour[dm]] &&
        dp[dm][vl] == dp[pre[dm] - 1][vl - child[tour[dm]]] + 1) {
      trace.push_back(tour[dm]);
      vl -= child[tour[dm]];
      dm = pre[dm] - 1;
    } else {
      dm = dm - 1;
    }
  }
  cout << ans << endl;
  for (int i = 0; i < trace.size(); i++) {
    cout << idx[trace[i]][par[trace[i]]] << " ";
  }
}
