#include <bits/stdc++.h>
using namespace std;
int n, k;
int dep[1000100];
int sel[1000100];
vector<int> vec[1001000];
int fa[1001000][22];
void tree_dfs(int x, int y, int d) {
  dep[x] = d;
  for (int i = vec[x].size() - 1; i >= 0; i--) {
    int num = vec[x][i];
    if (num != y) {
      fa[num][0] = x;
      tree_dfs(num, x, d + 1);
    }
  }
}
bool check(int x) {
  int ori = x;
  for (int i = 20; i >= 0; i--) {
    if (fa[x][i] != 0 && sel[fa[x][i]] != 1) x = fa[x][i];
  }
  if ((dep[ori] - dep[x] + 1) > k) return false;
  return true;
}
int add(int x) {
  int num = 0;
  while (sel[x] != 1 && x != 0) {
    sel[x] = 1;
    x = fa[x][0];
    num++;
  }
  return num;
}
int main() {
  memset(fa, 0, sizeof(fa));
  memset(sel, 0, sizeof(sel));
  memset(dep, 0, sizeof(dep));
  scanf("%d %d", &n, &k);
  k = n - k;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
  tree_dfs(n, 0, 0);
  for (int i = 1; i <= 20; i++) {
    for (int j = 1; j <= n; j++) {
      fa[j][i] = fa[fa[j][i - 1]][i - 1];
    }
  }
  for (int i = n; i >= 1; i--) {
    if (k == 0) break;
    if (check(i)) k -= add(i);
  }
  int tmp = 0;
  for (int i = 1; i <= n; i++) {
    if (sel[i] == 0) {
      if (tmp == 0) {
        tmp = 1;
        cout << i;
      } else {
        cout << " " << i;
      }
    }
  }
  return 0;
}
