#include <bits/stdc++.h>
using namespace std;
int up[1000005][20], siz[1000005];
vector<int> v[1000005], res;
bool vis[1000005];
void dfshelper(int u, int dad) {
  up[u][0] = dad;
  for (int i = 1; i < 20; ++i) up[u][i] = up[up[u][i - 1]][i - 1];
  for (auto i : v[u])
    if (i != dad) {
      ++siz[u];
      dfshelper(i, u);
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = n, x, y; --i; v[x].push_back(y), v[y].push_back(x))
    cin >> x >> y;
  dfshelper(n, n);
  k = n - k;
  vis[n] = 1;
  --k;
  for (int i = n - 1; i > 0 && k > 0; --i)
    if (!vis[i]) {
      int dis = 0, u = i;
      while (!vis[up[u][0]]) {
        for (int i = 20; i--;)
          if (!vis[up[u][i]]) {
            dis += (1 << i);
            u = up[u][i];
            break;
          }
      }
      ++dis;
      if (dis > k) continue;
      k -= dis;
      for (int u = i; !vis[u]; u = up[u][0]) vis[u] = 1;
    }
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) cout << i << ' ';
}
