#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
vector<int> vec[maxn];
int vis[maxn], in[maxn];
int p[maxn][21];
void dfs(int o, int fa) {
  p[o][0] = fa;
  vis[o] = 1;
  for (int i = 1; i <= 20 && p[p[o][i - 1]][i - 1]; i++)
    p[o][i] = p[p[o][i - 1]][i - 1];
  int sz = vec[o].size();
  for (int i = 0; i < sz; i++) {
    int v = vec[o][i];
    if (vis[v]) continue;
    dfs(v, o);
  }
}
int cal(int o, int k) {
  int ans = o;
  for (int i = 20; k && i >= 0; i--) {
    if (k >= (1 << i)) {
      k -= (1 << i);
      ans = p[ans][i];
    }
  }
  return ans;
}
int ans[maxn];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    vec[u].push_back(v), vec[v].push_back(u);
  }
  dfs(n, n);
  in[n] = 1;
  k--;
  for (int i = n; i >= 1 && k; i--) {
    if (in[i]) continue;
    int rt = cal(i, k);
    if (in[rt]) {
      int fa = i;
      while (!in[fa]) {
        in[fa] = 1;
        fa = p[fa][0];
        k--;
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!in[i]) ans[cnt++] = i;
  }
  for (int i = 0; i < cnt; i++) {
    if (!i)
      printf("%d", ans[i]);
    else
      printf(" %d", ans[i]);
  }
  printf("\n");
  return 0;
}
