#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010000;
const int max2 = 23;
using namespace std;
const int N = 2100002;
const int BSZ = 25, BNUM = 2100010 / BSZ + 10;
struct ST {
  long long n, m;
  array<long long, 2100010> s, Lmax, Rmax, bel;
  array<long long, BNUM> L, R, LG, ST[20 + 1];

 private:
  inline long long query(int l, int r) {
    if (l >= r) return LLONG_MIN;
    static int t;
    t = LG[r - l];
    return max(ST[t][l], ST[t][r - (1 << t)]);
  }

 public:
  void init(int k) {
    n = k;
    for (int i = 1; i <= n; ++i) bel[i] = i / BSZ + 1;
    const int B = bel[n];
    LG[0] = -1;
    for (int i = 1; i <= B; ++i) LG[i] = LG[i >> 1] + 1;
    for (int i = 1; i <= B; ++i) {
      L[i] = (i - 1) * BSZ;
      R[i] = L[i] + BSZ - 1;
    }
    L[1] = 1, R[B] = n;
    long long last = LLONG_MIN;
    for (int i = 1, now = 1; i <= n; ++i) {
      Lmax[i] = last = std::max(s[i], last);
      if (i >= R[now]) ST[0][now] = Lmax[i], last = LLONG_MIN, ++now;
    }
    last = LLONG_MIN;
    for (int i = n, now = B; i; --i) {
      Rmax[i] = last = max(s[i], last);
      if (i <= L[now]) last = LLONG_MIN, --now;
    }
    for (int i = 1, pw = 1; i <= 20; ++i, pw <<= 1) {
      for (int j = 1; j <= B; ++j)
        ST[i][j] = std::max(ST[i - 1][j], ST[i - 1][std::min(j + pw, B)]);
    }
  }
  long long query1(int l, int r) {
    if (l > r) swap(l, r);
    const int lb = bel[l], rb = bel[r];
    if (lb != rb)
      return max(max(Rmax[l], Lmax[r]), query(lb + 1, rb));
    else {
      static long long res;
      res = LLONG_MIN;
      for (int i = l; i <= r; ++i) res = max(res, s[i]);
      return res;
    }
  }
} p;
struct Edge {
  int to, next;
} edge[N << 1];
int tot, m, root, u, v, cnt1, cnt2, x, y, ddd;
int pre[N], first[N], a[N], depth[N], dfslen[N];
inline void addEdge(int u, int v) {
  ++tot;
  edge[tot].to = v;
  edge[tot].next = pre[u];
  pre[u] = tot;
}
void dfs(int u, int fa) {
  dfslen[u] = ++ddd;
  int now = ++cnt1;
  a[now] = u;
  p.s[++cnt2] = -now;
  first[u] = cnt2;
  for (int i = pre[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    depth[v] = depth[u] + 1;
    dfs(v, u);
    p.s[++cnt2] = -now;
  }
}
int LCA(int x, int y) { return a[-p.query1(first[x], first[y])]; }
set<pair<int, int> > sss[10];
int color[2100010], dis[2100010];
int getdis(int a, int b) {
  int lca = LCA(a, b);
  return depth[a] + depth[b] - 2 * depth[lca];
}
void ins(int a, int b) {
  if (sss[a].size() == 0) {
    dis[a] = 0;
  } else if (sss[a].size() == 1) {
    dis[a] = getdis(sss[a].begin()->second, b);
  }
  sss[a].insert({dfslen[b], b});
  if (sss[a].size() > 2) {
    auto it = sss[a].find({dfslen[b], b});
    auto it1 = it, it2 = it;
    if (it == sss[a].begin()) {
      it1++;
      it2 = sss[a].end();
      it2--;
    } else {
      it1++;
      it2--;
      if (it1 == sss[a].end()) it1 = sss[a].begin();
    }
    dis[a] *= 2;
    dis[a] += getdis(it1->second, it->second);
    dis[a] += getdis(it2->second, it->second);
    dis[a] -= getdis(it2->second, it1->second);
    dis[a] /= 2;
  }
}
void del(int a, int b) {
  if (sss[a].size() == 2) {
    sss[a].erase({dfslen[b], b});
    dis[a] = 0;
    return;
  } else if (sss[a].size() == 1) {
    sss[a].clear();
    dis[a] = -1;
    return;
  }
  auto it = sss[a].find({dfslen[b], b});
  auto it1 = it, it2 = it;
  if (it == sss[a].begin()) {
    it1++;
    it2 = sss[a].end();
    it2--;
  } else {
    it1++;
    it2--;
    if (it1 == sss[a].end()) {
      it1 = sss[a].begin();
    }
  }
  dis[a] *= 2;
  dis[a] -= getdis(it1->second, it->second);
  dis[a] -= getdis(it2->second, it->second);
  dis[a] += getdis(it2->second, it1->second);
  dis[a] /= 2;
  sss[a].erase(it);
}
bool ans[1000010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, k;
  cin >> n >> k;
  int u, v;
  ddd = 0;
  depth[1] = 1;
  memset(dis, -1, sizeof(dis));
  for (int i = 0; i < n - 1; ++i) {
    cin >> u >> v;
    addEdge(u, v);
    addEdge(v, u);
  }
  root = 1;
  dfs(root, -1);
  p.init(cnt2);
  for (int i = n; i >= 1; --i) {
    ins(1, i);
    if (dis[1] > n - k - 1) del(1, i);
  }
  for (auto &p : sss[1]) ans[p.second] = true;
  for (int i = 1; i <= n; ++i)
    if (!ans[i]) cout << i << " ";
  return 0;
}
