#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
int n, k;
vector<int> g[N];
bool used[N];
int parent[N], dep[N];
int dp[N][22];
void dfs(int v, int r) {
  dep[v] = r;
  dp[v][0] = parent[v];
  for (int i = 1; i <= 20; i++) {
    dp[v][i] = dp[dp[v][i - 1]][i - 1];
  }
  for (int i = 0; i < (int)g[v].size(); i++) {
    int to = g[v][i];
    if (to == parent[v]) continue;
    parent[to] = v;
    dfs(to, r + 1);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  parent[n] = n;
  used[n] = true;
  dfs(n, 0);
  --k;
  for (int i = n - 1; i >= 1; i--) {
    if (used[i]) continue;
    int v = i;
    for (int j = 20; j >= 0; j--) {
      if (used[dp[v][j]] == false) {
        v = dp[v][j];
      }
    }
    v = parent[v];
    if (dep[i] - dep[v] <= k) {
      k -= dep[i] - dep[v];
      int gag = i;
      while (gag != v) {
        used[gag] = true;
        gag = parent[gag];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (used[i] == false) {
      printf("%d ", i);
    }
  }
  printf("\n");
  return 0;
}
