#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
template <typename T, typename P>
void reset(T array[], int size, P value) {
  for (int i = 0; i < (size); i++) array[i] = value;
}
template <typename T, typename P>
void reset(T *array, int rows, int cols, P value) {
  for (int i = 0; i < (rows); i++)
    for (int j = 0; j < (cols); j++) *(array + i * cols + j) = value;
}
template <typename T>
void reset(T v[], int size) {
  for (int i = 0; i < size; i++) v[i].clear();
}
template <typename T>
T maxArr(T array[], int ending) {
  T res = array[0];
  for (int i = 0; i < (ending); i++) res = max(array[i], res);
  return res;
}
template <typename T>
T minArr(T array[], int ending) {
  T res = array[0];
  for (int i = 0; i < (ending); i++) res = min(array[i], res);
  return res;
}
template <typename T, typename P = long long int>
P sumArr(T array[], int ending) {
  P res = 0;
  for (int i = 0; i < (ending); i++) res = res + array[i];
  return res;
}
template <typename T, typename P = long long int>
P sumArr(T array[], int ending, P mod) {
  P res = 0;
  for (int i = 0; i < (ending); i++) res = (res + array[i]) % mod;
  return res;
}
int stringToNum(string &number) {
  int num = 0;
  int mul = 1;
  for (int i = ((int)(number.size())) - 1; i >= 0; --i) {
    num = num + (number[i] - '0') * mul;
    mul = mul * 10;
  }
  return num;
}
int bit(long long int num) {
  int res = 0;
  for (long long int i = 0; (1ll << i) <= num; ++i) res = i;
  return res;
}
const int MAXN = 400 + 10;
const int MAXM = 400 + 10;
const int MAXLOG = 18;
const int MY_MAX = 1000000;
int t, n, k;
std::vector<pair<int, int> > adj[MAXN];
int dp1[MAXN][MAXN];
int dp2[MAXN][MAXN];
int temp1[MAXN];
int temp2[MAXN];
vector<int> poi1[MAXN];
vector<int> poi2[MAXN];
std::vector<int> vec1[MAXN][MAXN];
std::vector<int> vec2[MAXN][MAXN];
unordered_set<int> myset;
int subSize[MAXN];
void dfs1(int u, int par) {
  subSize[u] = 1;
  for (auto it : adj[u]) {
    int v = it.first;
    if (v == par) continue;
    dfs1(v, u);
    subSize[u] = subSize[v] + subSize[u];
  }
}
void dfs(int u, int par, int w) {
  dp1[u][0] = 0;
  dp2[u][0] = 0;
  dp1[u][1] = ((int)(adj[u].size()));
  for (auto it : adj[u]) vec1[u][1].push_back(it.second);
  for (auto it : adj[u]) {
    int v = it.first;
    int w1 = it.second;
    if (v == par) continue;
    dfs(v, u, w1);
    reset(temp1, MAXN, MY_MAX);
    reset(temp2, MAXN, MY_MAX);
    reset(poi1, MAXN);
    reset(poi2, MAXN);
    for (int i = 0; i < (k + 1); i++) temp1[i] = dp1[u][i];
    for (int i = 0; i < (k + 1); i++) temp2[i] = dp2[u][i];
    for (int i = 0; i < (k + 1); i++) poi1[i] = vec1[u][i];
    for (int i = 0; i < (k + 1); i++) poi2[i] = vec2[u][i];
    for (int i = 1; i <= (k); i++)
      for (int j = (1); j <= int(k - i); j++)
        if (temp1[i + j] > dp1[u][i] + dp1[v][j] - 2) {
          temp1[i + j] = min(temp1[i + j], dp1[u][i] + dp1[v][j] - 2);
          poi1[i + j].clear();
          myset.clear();
          for (auto it : vec1[u][i])
            if (it != w1) poi1[i + j].push_back(it), myset.insert(it);
          for (auto it : vec1[v][j])
            if (!((myset).find((it)) != (myset).end()) and it != w1)
              poi1[i + j].push_back(it);
        }
    for (int i = 0; i < (k + 1); i++)
      if (temp2[i] > dp1[v][i] or temp2[i] > dp2[v][i]) {
        poi2[i].clear();
        if (dp1[v][i] < dp2[v][i])
          poi2[i] = vec1[v][i];
        else
          poi2[i] = vec2[v][i];
        temp2[i] = min(dp1[v][i], dp2[v][i]);
      }
    for (int i = 0; i < (k + 1); i++) {
      dp1[u][i] = temp1[i];
      dp2[u][i] = temp2[i];
      vec1[u][i] = poi1[i];
      vec2[u][i] = poi2[i];
    }
  }
  if (par != -1) {
    dp1[u][subSize[u]] = 1;
    vec1[u][subSize[u]].clear();
    vec1[u][subSize[u]].push_back(w);
  } else
    dp1[u][subSize[u]] = 0;
}
int sol() {
  reset(&dp1[0][0], MAXN, MAXN, MY_MAX);
  reset(&dp2[0][0], MAXN, MAXN, MY_MAX);
  dfs1(0, -1);
  dfs(0, -1, 0);
  return 0;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (int i = 0; i < (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(make_pair(v, i + 1));
    adj[v].push_back(make_pair(u, i + 1));
  }
  sol();
  cout << min(dp1[0][k], dp2[0][k]) << endl;
  if (dp1[0][k] < dp2[0][k])
    for (auto it : vec1[0][k]) cout << it << " ";
  else
    for (auto it : vec2[0][k]) cout << it << " ";
  cout << endl;
  return 0;
}
