#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long int lxt() {
  long long int aaa;
  scanf("%lld", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
vector<int> adj[1000010];
int table[21][1000010];
int depth[1000010];
int parent[1000010];
void dfs(int s, int p, int d) {
  parent[s] = p;
  depth[s] = d;
  for (int i = 0; i < adj[s].size(); i++) {
    int t = adj[s][i];
    if (t == p) continue;
    dfs(t, s, d + 1);
  }
}
void lca_init(int n) {
  memset(table, -1, sizeof(table));
  for (int i = 0; i < n; i++) {
    table[0][i] = parent[i];
  }
  for (int i = 1; (1 << i) < n; i++) {
    for (int j = 0; j < n; j++) {
      if (table[i - 1][j] != -1) table[i][j] = table[i - 1][table[i - 1][j]];
    }
  }
}
int mark[1000010];
int main() {
  int n = nxt();
  int k = nxt();
  for (int i = 0; i < n - 1; i++) {
    int a = nxt() - 1;
    int b = nxt() - 1;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(n - 1, -1, 1);
  lca_init(n);
  int need = n - k;
  mark[n - 1] = 1;
  int cur = n - 1;
  cur--;
  need--;
  int mx = 0;
  while (need > 0) {
    mx = 0;
    int t = cur;
    if (mark[cur]) {
      cur--;
      continue;
    }
    for (int i = 20; i >= 0; i--) {
      if (table[i][t] == -1 || mark[table[i][t]]) continue;
      t = table[i][t];
      mx += (1 << i);
    }
    mx++;
    ;
    if (mx > need || mx == 0) {
      cur--;
    } else {
      need -= mx;
      int tmp = cur;
      while (tmp != table[0][t]) {
        mark[tmp] = 1;
        tmp = table[0][tmp];
      }
      mark[table[0][tmp]] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (!mark[i]) printf("%d ", i + 1);
  }
  printf("\n");
  return 0;
}
