#include <bits/stdc++.h>
using namespace std;
int n, k, tot, cnt;
int to[2008611], nex[2008611], head[2008611];
int dep[2008611], fa[2008611][22];
bool tag[2008611];
void add(int x, int y) {
  to[++tot] = y;
  nex[tot] = head[x];
  head[x] = tot;
}
void dfs(int now, int fat) {
  dep[now] = dep[fat] + 1;
  fa[now][0] = fat;
  for (int i = 1; (1 << i) <= dep[now]; ++i)
    fa[now][i] = fa[fa[now][i - 1]][i - 1];
  for (int i = head[now]; i; i = nex[i]) {
    int v = to[i];
    if (v == fat) continue;
    dfs(v, now);
  }
}
int query(int now) {
  int tmp = now;
  for (int i = 20; i >= 0; --i) {
    if ((1 << i) > dep[tmp]) continue;
    if (fa[tmp][i] && !tag[fa[tmp][i]]) tmp = fa[tmp][i];
  }
  return dep[now] - dep[tmp] + 1;
}
void update(int now) {
  while (tag[now] == 0) {
    tag[now] = 1;
    ++cnt;
    now = fa[now][0];
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1, x, y; i < n; ++i) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(n, 0);
  cnt = 1;
  tag[n] = 1;
  for (int i = n - 1; i; --i) {
    if (tag[i]) continue;
    int tmp = query(i);
    if (tmp + cnt <= n - k) update(i);
    if (n - k == cnt) break;
  }
  for (int i = 1; i <= n; ++i)
    if (!tag[i]) printf("%d ", i);
  return 0;
}
