#include <bits/stdc++.h>
using namespace std;
double eps = 1e-9;
const int INF = 1e9 + 7;
const long long LINF = 1e18 + 7;
const int N = 1e6 + 7;
const int LOGN = 21;
vector<int> g[N];
int up[N][LOGN], need;
bool have[N];
void dfs(int v, int p) {
  up[v][0] = p;
  for (int i = 1; i < LOGN; ++i) {
    up[v][i] = up[up[v][i - 1]][i - 1];
  }
  for (int to : g[v]) {
    if (to != p) {
      dfs(to, v);
    }
  }
}
void upd(int v) {
  while (!have[v]) {
    have[v] = true;
    v = up[v][0];
  }
}
void find(int v) {
  int dist = 0, a = v;
  for (int j = LOGN - 1; j >= 0;) {
    if (have[up[a][j]]) {
      j--;
      continue;
    }
    dist += (1 << j);
    a = up[a][j];
  }
  if (dist + 1 <= need) {
    need -= dist + 1;
    upd(v);
  }
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  need = n - k;
  for (int i = 0; i < (int)(n - 1); ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--, y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(n - 1, n - 1);
  have[n - 1] = true;
  need--;
  for (int i = n - 2; i >= 0 && need > 0; --i) {
    if (!have[i]) {
      find(i);
    }
  }
  for (int i = 0; i < (int)(n); ++i) {
    if (!have[i]) {
      printf("%d ", i + 1);
    }
  }
}
