#include <bits/stdc++.h>
const int sz = 1000100;
std::vector<int> edge[sz];
int p[sz];
bool ch[sz];
bool no[sz];
int now, to;
void dfs(int x) {
  for (int k = 0; k < edge[x].size(); k++) {
    int y = edge[x][k];
    if (y == p[x]) continue;
    p[y] = x;
    dfs(y);
  }
}
void set(int x) {
  if (no[x]) return;
  no[x] = true;
  for (int k = 0; k < edge[x].size(); k++) {
    int y = edge[x][k];
    if (y == p[x]) continue;
    set(y);
  }
}
void find(int x) {
  int hh = x;
  int yu = to - now;
  int cnt = 0;
  while (!ch[hh]) {
    cnt++;
    hh = p[hh];
  }
  if (cnt <= yu) {
    now += cnt;
    hh = x;
    while (!ch[hh]) {
      ch[hh] = true;
      hh = p[hh];
    }
  } else {
    cnt -= yu;
    hh = x;
    while (cnt--) {
      set(hh);
      hh = p[hh];
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  to = n - m;
  now = 1;
  ch[n] = true;
  for (int k = 1; k < n; k++) {
    int a, b;
    scanf("%d%d", &a, &b);
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  p[n] = n;
  dfs(n);
  for (int k = n - 1; k >= 1; k--) {
    if (no[k]) continue;
    find(k);
  }
  for (int k = 1; k <= n; k++)
    if (!ch[k]) printf("%d ", k);
}
