#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 1e6 + 5;
vector<int> adj[N];
int in[N], out[N], t, depth[N], bit[N], use[N], fa[N], n, k;
void dfs(int id, int pre, int dep) {
  in[id] = ++t;
  depth[id] = dep;
  fa[id] = pre;
  for (int i = 0; i < adj[id].size(); i++)
    if (adj[id][i] != pre) dfs(adj[id][i], id, dep + 1);
  out[id] = t;
}
void modify(int x, int v) {
  while (x <= n) {
    bit[x] += v;
    x += x & -x;
  }
}
int find(int x) {
  int ans = 0;
  while (x) {
    ans += bit[x];
    x -= x & -x;
  }
  return ans;
}
int main() {
  while (~scanf("%d%d", &n, &k)) {
    for (int i = 0; i < n - 1; i++) {
      int(a), (b);
      scanf("%d %d", &(a), &(b));
      adj[a].push_back(b);
      adj[b].push_back(a);
    }
    t = 0;
    dfs(n, n, 0);
    use[n] = 1;
    int maxV = n - 1;
    k = n - k - 1;
    for (int i = 1; i < n; i++) {
      modify(in[i], 1);
      modify(out[i] + 1, -1);
    }
    while (k) {
      if (find(in[maxV]) <= k) {
        int pt = maxV;
        while (!use[pt]) {
          modify(in[pt], -1);
          modify(out[pt] + 1, 1);
          use[pt] = 1;
          pt = fa[pt];
          k--;
        }
      }
      maxV--;
    }
    for (int i = 1; i <= n; i++)
      if (!use[i]) printf("%d ", i);
    puts("");
  }
}
