#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:536870912")
#pragma warning(disable : 4996)
using namespace std;
const int N = 1e6 + 100, L = 21;
vector<int> v[N];
int p[N][L], t[N], ht[N];
void dfs(int node, int anc, int h) {
  p[node][0] = anc;
  ht[node] = h;
  for (int i = 1; i < L; i++) p[node][i] = p[p[node][i - 1]][i - 1];
  for (int to : v[node]) {
    if (to != anc) dfs(to, node, h + 1);
  }
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < L; i++) p[n - 1][i] = n - 1;
  dfs(n - 1, n - 1, 0);
  t[n - 1] = 1;
  int rest = n - k - 1;
  for (int i = n - 2; i >= 0; i--) {
    if (t[i]) continue;
    int a = i;
    for (int j = L - 1; j >= 0; j--) {
      if (!t[p[a][j]]) a = p[a][j];
    }
    a = p[a][0];
    if (ht[i] - ht[a] <= rest) {
      int x = i;
      while (x != a) {
        t[x] = 1;
        x = p[x][0];
      }
      rest -= ht[i] - ht[a];
    }
  }
  for (int i = 0; i < n; i++) {
    if (!t[i]) printf("%d ", i + 1);
  }
  return 0;
}
