#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1100000;
int n, k;
vector<int> edge[MAXN], son[MAXN];
int fa[25][MAXN], ss[MAXN], vis[MAXN];
int out[MAXN], cnt;
queue<int> q;
void bfs(int y) {
  q.push(y);
  vis[y] = 1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    vis[x] = 1;
    int l = (int)edge[x].size();
    for (int i = 0; i < l; i++) {
      if (!vis[edge[x][i]]) {
        fa[0][edge[x][i]] = x;
        ss[x]++;
        son[x].push_back(edge[x][i]);
        q.push(edge[x][i]);
      }
    }
  }
}
int geta(int now) {
  int x = now, a = 0;
  while (!out[x]) {
    int k = 0;
    while (fa[k][x] != 0 && !out[fa[k][x]]) k++;
    k--;
    if (k < 0) {
      a++;
      return a;
    }
    a += (1 << k);
    x = fa[k][x];
  }
  return a;
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  bfs(n);
  for (int kk = 1; (1 << kk) <= n; kk++)
    for (int i = 1; i <= n; i++) fa[kk][i] = fa[kk - 1][fa[kk - 1][i]];
  int now = n;
  out[n] = 1;
  cnt++;
  while (cnt < k) {
    while (out[now]) now--;
    int t = now;
    if (geta(t) + cnt > k) {
      now--;
      continue;
    }
    while (!out[t]) {
      out[t] = 1;
      cnt++;
      t = fa[0][t];
    }
  }
  for (int i = 1; i <= n; i++)
    if (!out[i]) printf("%d ", i);
  return 0;
}
