#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, M = 2e6 + 10;
int head[N], ver[M], nxt[M], d[N];
int n, m, k, tot = 1, num = 0;
int f[N][22];
bool visit[N];
inline void add(int x, int y) {
  ver[++tot] = y, nxt[tot] = head[x], head[x] = tot;
}
inline void dfs(int x, int fa) {
  f[x][0] = fa;
  for (int i = 1; i <= 20; i++) f[x][i] = f[f[x][i - 1]][i - 1];
  for (int i = head[x]; i; i = nxt[i]) {
    int y = ver[i];
    if (y == fa) continue;
    dfs(y, x);
  }
}
inline int ask(int x) {
  int ans = 0;
  for (int i = 20; i >= 0; i--) {
    if (f[x][i] && !visit[f[x][i]]) {
      ans |= 1 << i;
      x = f[x][i];
    }
  }
  return ans + 1;
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  dfs(n, 0);
  k--;
  visit[n] = true;
  for (int i = n - 1; i && k; i--) {
    if (visit[i]) continue;
    int sum = ask(i);
    if (sum <= k) {
      k -= sum;
      for (int j = i; !visit[j]; j = f[j][0]) visit[j] = true;
    }
  }
  for (int i = 1; i <= n; i++)
    if (!visit[i]) printf("%d ", i);
  putchar('\n');
  return 0;
}
