#include <bits/stdc++.h>
using namespace std;
int n, k, x, y;
int take[1000005], baba[20 + 2][1000005];
vector<int> v[1000005];
void buildLCA() {
  for (int i = 1; i <= 20; i++) {
    for (int j = 1; j <= n; j++) {
      baba[i][j] = baba[i - 1][baba[i - 1][j]];
    }
  }
}
int get(int node) {
  int res = 1;
  for (int i = 20; i >= 0; i--) {
    if (take[baba[i][node]]) continue;
    node = baba[i][node];
    res += (1 << (i));
  }
  return res;
}
void dfs(int node, int ata) {
  baba[0][node] = ata;
  for (int i : v[node])
    if (i != ata) dfs(i, node);
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  take[0] = 1;
  dfs(n, 0);
  buildLCA();
  int now = 0;
  k = n - k;
  for (int i = n; i >= 0; i--) {
    if (take[i]) continue;
    int totup = get(i);
    if (now + totup > k) continue;
    int node = i;
    now += totup;
    while (!take[node]) {
      take[node] = 1;
      node = baba[0][node];
    }
  }
  for (int i = 1; i <= n; i++)
    if (!take[i]) printf("%d ", i);
}
