#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int LOGMAX = 21;
int n, k, o[N], otac[N], p[LOGMAX + 5][N], d[N], niz[N];
vector<int> V[N];
void dfs(int i) {
  o[i] = 1;
  for (int j = 0; j < V[i].size(); j++)
    if (!o[V[i][j]]) {
      otac[V[i][j]] = i;
      d[V[i][j]] = d[i] + 1;
      dfs(V[i][j]);
    }
}
void sparse() {
  for (int i = 0; i <= LOGMAX; i++)
    for (int j = 1; j <= n; j++) p[i][j] = -1;
  for (int i = 1; i < n; i++) p[0][i] = otac[i];
  for (int i = 1; i <= LOGMAX; i++)
    for (int j = 1; j <= n; j++)
      if (p[i - 1][j] != -1) p[i][j] = p[i - 1][p[i - 1][j]];
}
void lift(int x) {
  int y = x;
  for (int i = LOGMAX; i >= 0; i--)
    if (p[i][x] != -1 && !niz[p[i][x]]) x = p[i][x];
  x = p[0][x];
  if (d[y] - d[x] <= k) {
    k -= (d[y] - d[x]);
    while (y != x) {
      niz[y] = 1;
      y = otac[y];
    }
  }
  return;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    V[x].push_back(y);
    V[y].push_back(x);
  }
  otac[n] = -1;
  d[n] = 1;
  dfs(n);
  sparse();
  k = n - k - 1;
  for (int i = 1; i <= n; i++) niz[i] = 0;
  niz[n] = 1;
  for (int i = n - 1; i >= 1; i--)
    if (!niz[i]) lift(i);
  for (int i = 1; i <= n; i++)
    if (!niz[i]) printf("%d ", i);
  return 0;
}
