#include <bits/stdc++.h>
const int N = 1e6 + 10;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
using namespace std;
int n, k;
vector<int> E[N];
int fa[N][20];
bool vis[N];
void dfs(int u, int ff) {
  fa[u][0] = ff;
  for (int i = 1; i < 20; ++i) {
    fa[u][i] = fa[fa[u][i - 1]][i - 1];
  }
  for (int i = 0; i < E[u].size(); ++i) {
    int v = E[u][i];
    if (v ^ ff) dfs(v, u);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    E[u].push_back(v);
    E[v].push_back(u);
  }
  dfs(n, 0);
  vis[n] = 1;
  vis[0] = 1;
  k = n - k - 1;
  for (int i = n - 1; i >= 1; --i) {
    if (k == 0) break;
    if (vis[i]) continue;
    int dis = 1;
    int u = i;
    for (int j = 19; j >= 0; --j) {
      if (!vis[fa[u][j]]) {
        u = fa[u][j];
        dis += 1 << j;
      }
    }
    if (dis <= k) {
      u = i;
      while (!vis[u] && k) vis[u] = 1, k--, u = fa[u][0];
    } else
      continue;
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) cout << i << " ";
  return 0;
}
