#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return a > val ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
const int maxn = 410;
int n, k;
vector<pair<int, int> > edges;
vector<int> adj[maxn];
int from[maxn];
int f[maxn][maxn];
map<pair<int, int>, int> r[maxn];
int chosen[maxn];
void dfs(int u, int p = -1) {
  from[u] = p;
  f[u][0] = 1;
  f[u][1] = 0;
  for (int i = (0); i < (int((adj[u]).size())); i++) {
    int v = adj[u][i];
    if (v != p) {
      dfs(v, u);
      int g[maxn];
      fill_n(g, n + 1, INF);
      for (int j = (1); j < (n + 1); j++)
        for (int l = (0); l < (n + 1 - j); l++) {
          if (chkmin(g[j + l], f[u][j] + f[v][l])) {
            r[j + l][make_pair(u, v)] = l;
          }
        }
      for (int j = (1); j < (n + 1); j++) f[u][j] = g[j];
    }
  }
}
void trace(int u, int k) {
  chosen[u] = 1;
  for (int i = (int((adj[u]).size())) - 1; i >= (0); i--) {
    int v = adj[u][i];
    if (v != from[u]) {
      int l = r[k][make_pair(u, v)];
      if (l) {
        trace(v, l);
      }
      k -= l;
    }
  }
}
void solve() {
  cin >> n >> k;
  for (int i = (0); i < (n - 1); i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    edges.push_back(make_pair(u, v));
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = (0); i < (n); i++) fill_n(f[i], n + 1, INF);
  dfs(0);
  int ans = f[0][k], imin = 0;
  for (int i = (1); i < (n); i++)
    if (chkmin(ans, f[i][k] + 1)) imin = i;
  cout << ans << "\n";
  trace(imin, k);
  for (int i = (0); i < (int((edges).size())); i++) {
    int u = edges[i].first;
    int v = edges[i].second;
    if (chosen[u] + chosen[v] == 1) {
      cout << i + 1 << " ";
    }
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
