#include <bits/stdc++.h>
const int N = 1e6;
const int LOGN = 20;
struct Edge {
  int to, nxt;
} e[N * 2 + 10];
int head[N + 10], tote;
inline void addEdge(int u, int v) {
  e[++tote].to = v;
  e[tote].nxt = head[u];
  head[u] = tote;
}
int n, k;
bool vis[N + 10];
int fa[N + 10][LOGN + 5], dep[N + 10];
void DFSInit(int u, int _fa) {
  fa[u][0] = _fa;
  dep[u] = dep[_fa] + 1;
  for (int i = 1; i <= LOGN; i++) fa[u][i] = fa[fa[u][i - 1]][i - 1];
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (v == _fa) continue;
    DFSInit(v, u);
  }
}
inline int calc(int u) {
  int res = 0;
  for (int i = LOGN; ~i; i--)
    if (!vis[fa[u][i]]) res += (1 << i), u = fa[u][i];
  return res + 1;
}
void DFSCover(int u) {
  if (vis[u]) return;
  vis[u] = 1;
  if (fa[u][0]) {
    DFSCover(fa[u][0]);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addEdge(u, v);
    addEdge(v, u);
  }
  vis[0] = 1;
  vis[n] = 1;
  DFSInit(n, 0);
  int tmp = k - 1, cur = n - 1;
  while (cur) {
    if (vis[cur]) {
      cur--;
      continue;
    }
    int dis = calc(cur);
    if (tmp - dis >= 0) {
      tmp -= dis;
      DFSCover(cur);
    }
    cur--;
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  puts("");
  return 0;
}
