#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
const int M = 25;
vector<int> e[N];
int f[N][M], depth[N];
bool vis[N];
int tot, n, k;
void dfs(int rt, int fa) {
  f[rt][0] = fa;
  depth[rt] = depth[fa] + 1;
  for (int i = 1; i < M; i++) f[rt][i] = f[f[rt][i - 1]][i - 1];
  for (int v : e[rt]) {
    if (v != fa) dfs(v, rt);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k - 1;
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs(n, n);
  vis[n] = true;
  for (int i = n - 1; i >= 0; i--) {
    int x = i;
    for (int j = M - 1; j >= 0; j--)
      if (!vis[f[x][j]]) x = f[x][j];
    if (depth[i] - depth[x] + 1 <= k) {
      int y = i;
      while (!vis[y]) {
        vis[y] = true;
        y = f[y][0];
        k--;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%d ", i);
  return 0;
}
