#include <bits/stdc++.h>
using namespace std;
int LINK[2000005], l[1000005], ed[2000005];
int dep[1000005], num[1000005], ansec[1000005][23];
int n, m, x, y, z, k, w;
void bd(int x, int y) {
  LINK[w] = l[x];
  l[x] = w;
  ed[w] = y;
  w++;
}
void precompute(int x, int y) {
  if (y == -1)
    dep[x] = 0;
  else
    dep[x] = dep[y] + 1;
  int tmp;
  if (y != -1) {
    ansec[x][num[x]++] = y;
    for (int i = (1); i <= (22); i++) {
      tmp = ansec[x][i - 1];
      if (num[tmp] > i - 1)
        ansec[x][num[x]++] = ansec[tmp][i - 1];
      else
        break;
    }
  }
  for (int i = l[x]; i != -1; i = LINK[i]) {
    if (ed[i] == y) continue;
    precompute(ed[i], x);
  }
}
int res[2000005], remain;
int find(int x) {
  int y = x;
  for (int i = (22); i >= (0); i--) {
    if (num[y] <= i) continue;
    if (res[ansec[y][i]] == 0) y = ansec[y][i];
  }
  y = ansec[y][0];
  return dep[x] - dep[y];
}
void update(int x) {
  int y = x;
  while (res[y] == 0) res[y] = 1, remain--, y = ansec[y][0];
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = (1); i <= (n); i++) l[i] = -1;
  for (int i = (0); i < (n - 1); i++) {
    scanf("%d %d", &x, &y);
    bd(x, y);
    bd(y, x);
  }
  precompute(n, -1);
  int a = n;
  int b = -1;
  res[n] = 1;
  remain = n - m - 1;
  for (int i = (n - 1); i >= (1); i--) {
    if (find(i) <= remain) update(i);
  }
  for (int i = (1); i <= (n); i++)
    if (res[i] == 0) printf("%d ", i);
  return 0;
}
