#include <bits/stdc++.h>
using namespace std;
int N, K;
vector<int> adj[1000001];
int power;
int anc[1000001][22];
bool captured[1000001];
void dfs(int node, int prev) {
  anc[node][0] = prev;
  for (int v : adj[node])
    if (v != prev) dfs(v, node);
}
int dis(int node) {
  int ans = 0;
  for (int i = 21; i >= 0; i--) {
    if (!captured[anc[node][i]]) {
      node = anc[node][i];
      ans += (1 << i);
    }
  }
  return ans + 1;
}
int main() {
  scanf("%d%d", &N, &K);
  power = N - K - 1;
  for (int i = 1; i < N; i++) {
    int X, Y;
    scanf("%d%d", &X, &Y);
    adj[X].push_back(Y);
    adj[Y].push_back(X);
  }
  dfs(N, N);
  for (int i = 1; i <= 21; i++)
    for (int j = 1; j <= N; j++) anc[j][i] = anc[anc[j][i - 1]][i - 1];
  captured[N] = true;
  for (int i = N - 1; i >= 1; i--) {
    if (captured[i]) continue;
    int temp = dis(i);
    if (temp <= power) {
      power -= temp;
      int cur = i;
      while (!captured[cur]) {
        captured[cur] = true;
        cur = anc[cur][0];
      }
    }
  }
  for (int i = 1; i <= N; i++)
    if (!captured[i]) printf("%d ", i);
  printf("\n");
  return 0;
}
