#include <bits/stdc++.h>
using namespace std;
int dp[405][405], mochila[405][405], road[405][405], father[405];
bool visited[405];
vector<int> adj[405];
int pega[405][405];
int i_mochila[405][405];
int p;
int min_p = 1000, root = 0;
int n, k;
int knapsack(int v, int pai, int pos, int val, int k) {
  if (pos == adj[v].size() and val == 0) {
    return 0;
  }
  if (pos == adj[v].size() or val < 0) {
    return 1000;
  }
  int u = adj[v][pos];
  if (mochila[u][val] != -1) return mochila[u][val];
  int nao_pega = 1 + knapsack(v, pai, pos + 1, val, k);
  if (u == pai) return nao_pega - 1;
  int pegar = 1000;
  int qtd = 0;
  for (int i = 1; i <= val; i++) {
    if (dp[u][i] == -1) continue;
    int pegar_atual = dp[u][i] + knapsack(v, pai, pos + 1, val - i, k);
    if (pegar_atual < pegar) {
      pegar = pegar_atual;
      qtd = i;
    }
  }
  if (pegar < nao_pega and pegar < 1000) {
    pega[u][val] = qtd;
    return mochila[u][val] = pegar;
  }
  return mochila[u][val] = nao_pega;
}
void dfs(int v, int pai) {
  if (adj[v].size() == 0) return;
  father[v] = pai;
  if (adj[v].size() == 1 and adj[v][0] == pai) {
    dp[v][1] = 0;
    return;
  }
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u != pai) dfs(u, v);
  }
  int pos = 0;
  if (adj[v][0] == pai) pos++;
  for (int i = 0; i < k; i++) dp[v][i + 1] = knapsack(v, pai, pos, i, i + 1);
  int val = dp[v][k];
  if (val == -1) return;
  if (v != pai) val++;
  if (val < min_p) min_p = val, root = v;
}
int main() {
  memset(dp, -1, sizeof dp);
  memset(mochila, -1, sizeof mochila);
  memset(pega, 0, sizeof pega);
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    road[x][y] = road[y][x] = i;
    adj[y].push_back(x);
    adj[x].push_back(y);
  }
  dfs(1, 1);
  if (min_p == 1000) {
    cout << 0 << endl;
    return 0;
  }
  vector<int> resp;
  queue<pair<int, int> > fila;
  fila.push({root, k});
  int val = 1000;
  if (root != 1) resp.push_back(road[father[root]][root]);
  while (!fila.empty()) {
    pair<int, int> frente = fila.front();
    fila.pop();
    int v = frente.first;
    val = frente.second - 1;
    visited[v] = true;
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (visited[u] or u == father[v]) continue;
      if (pega[u][val] != 0) {
        fila.push({u, pega[u][val]});
        val -= pega[u][val];
      } else {
        resp.push_back(road[v][u]);
      }
    }
  }
  cout << min_p << endl;
  for (int i = 0; i < resp.size(); i++) cout << resp[i] << " ";
  cout << endl;
  return 0;
}
