#include <bits/stdc++.h>
using namespace std;
int n, k, head[1000010], Next[2 * 1000010], ver[2 * 1000010], tot,
    f[1000010][21], mark[1000010], x, y;
void add(int a, int b) {
  Next[++tot] = head[a];
  head[a] = tot;
  ver[tot] = b;
}
void dfs(int a, int pre) {
  for (int i = 1; i <= 20; i++) f[a][i] = f[f[a][i - 1]][i - 1];
  for (int i = head[a]; i; i = Next[i]) {
    int b = ver[i];
    if (b == pre) continue;
    f[b][0] = a;
    dfs(b, a);
  }
}
int find(int a) {
  int size = 1;
  for (int i = 20; i >= 0; i--)
    if (f[a][i] && !mark[f[a][i]]) size += 1 << i, a = f[a][i];
  return size;
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) scanf("%d%d", &x, &y), add(x, y), add(y, x);
  dfs(n, 0);
  for (int i = n; i >= 1 && k; i--) {
    if (mark[i]) continue;
    int size = find(i);
    if (size <= k) {
      k -= size;
      int x = i;
      while (!mark[x]) {
        mark[x] = 1;
        x = f[x][0];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!mark[i]) printf("%d ", i);
  printf("\n");
  return 0;
}
