#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
const int LOGN = 20;
int n, k;
vector<int> graph[MAXN + 5];
int pa[LOGN + 1][MAXN + 5];
int depth[MAXN + 5];
int par[MAXN + 5];
void dfs(int u, int p, int d) {
  depth[u] = d;
  par[u] = p;
  pa[0][u] = p;
  for (int j = 1; j <= LOGN; j++) {
    if (pa[j - 1][u] != -1)
      pa[j][u] = pa[j - 1][pa[j - 1][u]];
    else
      pa[j][u] = -1;
  }
  for (auto v : graph[u]) {
    if (v != p) dfs(v, u, d + 1);
  }
}
bool vis[MAXN + 5];
int main() {
  int i, j, d;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  dfs(n, -1, 0);
  int rem = n - k;
  vis[n] = true;
  rem--;
  for (int i = n; i >= 1; i--) {
    if (vis[i]) continue;
    int u = i;
    for (int j = LOGN; j >= 0; j--) {
      int par = pa[j][u];
      if (par != -1) {
        if (!vis[par]) u = par;
      }
    }
    while (par[u] != -1 && !vis[par[u]]) u = par[u];
    int cnt = (depth[i] - depth[u] + 1);
    if (cnt <= rem) {
      int curr = i;
      while (!vis[curr]) {
        vis[curr] = true;
        curr = par[curr];
      }
      rem -= cnt;
    }
  }
  int cntprint = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cntprint++;
      printf("%d ", i);
    }
  }
  printf("\n");
  return 0;
}
