#include <bits/stdc++.h>
using namespace std;
int N, K;
vector<int> G[1000000 + 5];
int Anc[1000000 + 5][20 + 5], Dep[1000000 + 5];
void dfs(int u, int f, int d) {
  Anc[u][0] = f, Dep[u] = d;
  for (int i = 0; i < int(G[u].size()); i++) {
    int v = G[u][i];
    if (v != f) dfs(v, u, d + 1);
  }
}
bool C[1000000 + 5];
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(N, N, 1);
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= N; i++) Anc[i][j] = Anc[Anc[i][j - 1]][j - 1];
  C[N] = 1;
  int Remain = N - K - 1;
  for (int i = N - 1; i >= 1; i--) {
    if (C[i]) continue;
    int t = i, u = i;
    for (int j = 20; j >= 0; j--) {
      if (!C[Anc[u][j]]) u = Anc[u][j];
    }
    int d = Dep[t] - Dep[u] + 1;
    if (d <= Remain) {
      Remain -= d;
      while (!C[t]) C[t] = 1, t = Anc[t][0];
    }
  }
  for (int i = 1; i <= N; i++)
    if (!C[i]) printf("%d ", i);
}
