#include <bits/stdc++.h>
inline void read(int &v) {
  int k = 0, l = 1;
  char ch;
  ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') l = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') k = k * 10 + ch - '0', ch = getchar();
  v = l * k;
}
inline void print(int v) {
  if (v < 0) putchar('-'), v = -v;
  if (v > 9) print(v / 10);
  putchar(v % 10 + '0');
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
static const int MAXN = 1e6 + 5;
using std::swap;
using std::vector;
static int n, tot, m, root;
static int Head[MAXN], vet[MAXN << 1], Next[MAXN << 1];
static int id[MAXN << 1], son[MAXN << 1], size[MAXN << 1], w[MAXN << 1];
static int wt[MAXN << 1], fa[MAXN << 1], top[MAXN << 1], dep[MAXN << 1];
static int tree[MAXN << 2], lazy[MAXN << 2], k;
void add(int a, int b) {
  Next[++tot] = Head[a];
  vet[tot] = b;
  Head[a] = tot;
}
void build(int l, int r, int p) {
  if (l == r) {
    tree[p] = wt[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, p << 1);
  build(mid + 1, r, p << 1 | 1);
  tree[p] = (tree[p << 1] + tree[p << 1 | 1]);
}
void pushdown(int l, int r, int p) {
  if (lazy[p]) {
    int mid = (l + r) >> 1;
    tree[p << 1] = tree[p << 1 | 1] = 0;
    lazy[p << 1 | 1] = lazy[p << 1] = 1;
    lazy[p] = 0;
  }
}
void maintain(int l, int r, int p, int st, int ed, int v) {
  if (st <= l && ed >= r) {
    tree[p] = 0;
    lazy[p] = 1;
    return;
  }
  pushdown(l, r, p);
  int mid = (l + r) >> 1;
  if (ed <= mid)
    maintain(l, mid, p << 1, st, ed, v);
  else if (st > mid)
    maintain(mid + 1, r, p << 1 | 1, st, ed, v);
  else
    maintain(l, mid, p << 1, st, ed, v),
        maintain(mid + 1, r, p << 1 | 1, st, ed, v);
  tree[p] = (tree[p << 1] + tree[p << 1 | 1]);
}
int query(int l, int r, int p, int st, int ed) {
  if (st <= l && ed >= r) {
    return tree[p];
  }
  pushdown(l, r, p);
  int mid = (l + r) >> 1;
  if (ed <= mid)
    return query(l, mid, p << 1, st, ed);
  else if (st > mid)
    return query(mid + 1, r, p << 1 | 1, st, ed);
  else
    return (query(l, mid, p << 1, st, ed) +
            query(mid + 1, r, p << 1 | 1, st, ed));
  tree[p] = (tree[p << 1] + tree[p << 1 | 1]);
}
void dfs1(int x, int pre, int deep) {
  int maxson = -1e9;
  size[x] = 1;
  fa[x] = pre;
  dep[x] = deep;
  for (int i = Head[x]; i; i = Next[i]) {
    int y = vet[i];
    if (y == pre) continue;
    dfs1(y, x, deep + 1);
    size[x] += size[y];
    if (size[y] > maxson) {
      maxson = size[y];
      son[x] = y;
    }
  }
}
void dfs2(int x, int pre) {
  id[x] = ++tot;
  wt[tot] = w[x];
  top[x] = pre;
  if (!son[x]) return;
  dfs2(son[x], pre);
  for (int i = Head[x]; i; i = Next[i]) {
    int y = vet[i];
    if (fa[x] == y || y == son[x]) continue;
    dfs2(y, y);
  }
}
void up1(int x, int y, int k) {
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    maintain(1, n, 1, id[top[x]], id[x], k);
    x = fa[top[x]];
  }
  if (dep[x] < dep[y]) swap(x, y);
  maintain(1, n, 1, id[y], id[x], k);
}
int query1(int x, int y) {
  int ans = 0;
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    ans = (ans + query(1, n, 1, id[top[x]], id[x]));
    x = fa[top[x]];
  }
  if (dep[x] < dep[y]) swap(x, y);
  return ans = ((ans + query(1, n, 1, id[y], id[x])));
}
int main() {
  read(n), read(k);
  for (int i = 1; i < n; ++i) {
    int x, y;
    read(x), read(y);
    add(x, y);
    add(y, x);
  }
  tot = 0;
  for (int i = 1; i <= n; ++i) w[i] = 1;
  w[n] = 0;
  dfs1(n, 0, 1);
  dfs2(n, n);
  build(1, n, 1);
  k = n - k - 1;
  for (int i = n - 1; i >= 1; --i) {
    int low = query1(n, i);
    if (low <= k) {
      k -= low;
      up1(i, n, 0);
      if (k == 0) break;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (query(1, n, 1, id[i], id[i]) == 1) print(i), putchar(' ');
  }
  return 0;
}
