#include <bits/stdc++.h>
using namespace std;
int N, K, tam;
vector<int> ady[1000005];
int papa[1000005][20 + 3];
int nivel[1000005];
bool vis[1000005];
void dfs(int x, int p, int n) {
  nivel[x] = n;
  papa[x][0] = p;
  for (auto v : ady[x])
    if (v != p) dfs(v, x, n + 1);
}
void dist(int x) {
  int tmp = x;
  if (vis[x]) return;
  int b = nivel[x];
  for (int i = 20; i >= 0; i--)
    if (!vis[papa[x][i]]) x = papa[x][i];
  int a = nivel[x];
  int need = b - a + 1;
  if (tam + need <= K) {
    tam += need;
    while (!vis[tmp]) {
      vis[tmp] = true;
      tmp = papa[tmp][0];
    }
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N >> K;
  K = N - K;
  for (int i = 1; i < N; i++) {
    int u, v;
    cin >> u >> v;
    ady[u].push_back(v);
    ady[v].push_back(u);
  }
  dfs(N, 0, 1);
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= N; i++) papa[i][j] = papa[papa[i][j - 1]][j - 1];
  tam = 1;
  vis[0] = true;
  vis[N] = true;
  for (int i = N; i >= 1; i--) dist(i);
  for (int i = 1; i <= N; i++)
    if (!vis[i]) cout << i << " ";
  return 0;
}
