#include <bits/stdc++.h>
using namespace std;
struct edge {
  int next, to;
};
edge G[2000100];
int head[1000100];
int Deep[1000100], Anc[1000100][20];
bool Mark[1000100];
int N, K, cnt = 2, Count = 0;
inline void Add_Edge(int u, int v) {
  G[cnt].to = v;
  G[cnt].next = head[u];
  head[u] = cnt++;
  return;
}
void DFS_Init(int u, int fa) {
  for (int i = 1; i <= 19; i++) Anc[u][i] = Anc[Anc[u][i - 1]][i - 1];
  for (int i = head[u]; i; i = G[i].next) {
    int v = G[i].to;
    if (v == fa) continue;
    Deep[v] = Deep[u] + 1;
    Anc[v][0] = u;
    DFS_Init(v, u);
  }
  return;
}
inline void Matain(int u) {
  int v = u, Calc = 1;
  for (register int i = 19; i >= 0; i--)
    if (!Mark[Anc[v][i]]) {
      Calc += (1 << i);
      v = Anc[v][i];
    }
  if (Calc + Count > K) return;
  Count += Calc;
  while (u != v) {
    Mark[u] = true;
    u = Anc[u][0];
  }
  Mark[v] = true;
  return;
}
int main() {
  scanf("%d%d", &N, &K);
  for (register int i = 1; i <= N - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    Add_Edge(u, v);
    Add_Edge(v, u);
  }
  DFS_Init(N, 0);
  Mark[N] = Mark[0] = true;
  Count = 1;
  K = N - K;
  for (register int i = N - 1; i >= 1; i--) {
    if (Count == K) break;
    if (Mark[i]) continue;
    Matain(i);
  }
  for (register int i = 1; i <= N; i++)
    if (!Mark[i]) printf("%d ", i);
  return 0;
}
