#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
int n, k, in[N], out[N], lol, seg[4 * N], depth[N], lazy[4 * N], par[N], id[N],
    val, ans[N], s, e;
vector<int> g[N];
bool vis[N];
void dfs(int u, int p) {
  id[lol] = u;
  in[u] = lol++;
  par[u] = p;
  for (auto i : g[u])
    if (i != p) depth[i] = depth[u] + 1, dfs(i, u);
  out[u] = lol - 1;
}
void fix(int c, int l, int r) {
  seg[c] = max(seg[c], lazy[c]);
  if (l != r) {
    lazy[2 * c + 1] = max(lazy[2 * c + 1], lazy[c]);
    lazy[2 * c + 2] = max(lazy[2 * c + 2], lazy[c]);
  }
  lazy[c] = -1;
}
int get(int c, int l, int r) {
  fix(c, l, r);
  if (l > s || r < s) return -1;
  if (l == r) return seg[c];
  return max(get(2 * c + 1, l, (l + r) / 2),
             get(2 * c + 2, (l + r) / 2 + 1, r));
}
void update(int c, int l, int r) {
  fix(c, l, r);
  if (l > e || r < s) return;
  if (l >= s && r <= e) {
    lazy[c] = val;
    fix(c, l, r);
    return;
  }
  update(2 * c + 1, l, (l + r) / 2);
  update(2 * c + 2, (l + r) / 2 + 1, r);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1, a, b; i < n; i++) {
    scanf("%d%d", &a, &b);
    g[--a].push_back(--b);
    g[b].push_back(a);
  }
  k = n - k;
  int rem = 0;
  depth[n - 1] = 1;
  dfs(n - 1, -1);
  memset(seg, -1, sizeof seg);
  memset(lazy, -1, sizeof lazy);
  for (int i = n - 1; i + 1; i--)
    if (!vis[i]) {
      s = in[i];
      int x = get(0, 0, n), at = i;
      if (x != -1) x = id[x];
      if (x != -1 && k < depth[i] - depth[x]) {
        ans[rem++] = i + 1;
        continue;
      }
      k -= depth[i];
      if (x != -1) k += depth[x];
      while (at != x && at != -1) {
        vis[at] = 1;
        val = in[at];
        s = in[at];
        e = out[at];
        update(0, 0, n);
        at = par[at];
      }
    }
  sort(ans, ans + rem);
  for (int i = 0; i < rem; i++) printf("%d ", ans[i]);
}
