As you may already know, Dušan is keen on playing with railway models. He has a big map with cities that are connected with railways. His map can be seen as a graph where vertices are cities and the railways connecting them are the edges. So far, the graph corresponding to his map is a tree. As you already know, a tree is a connected acyclic undirected graph.

He is curious to find out whether his railway can be optimized somehow. He wants to add so-called shortcuts, which are also railways connecting pairs of cities. This shortcut will represent the railways in the unique path in the tree between the pair of cities it connects. Since Dušan doesn't like repeating the railways, he has also defined good paths in his newly obtained network (notice that after adding the shortcuts, his graph is no more a tree). He calls a path good, if no edge appears more than once, either as a regular railway edge or as an edge represented by some shortcut (Every shortcut in a good path has length 1, but uses up all the edges it represents - they can't appear again in that path). Having defined good paths, he defines good distance between two cities to be the length of the shortest good path between them. Finally, the shortcutting diameter of his network is the largest good distance between any two cities.

Now he is curious to find out whether it is possible to achieve shortcutting diameter less or equal than k, while adding as few shortcuts as possible.

Your solution should add no more than 10 ⋅ n shortcuts.

Input

The first line in the standard input contains an integer n (1 ≤ n ≤ 10^4), representing the number of the cities in Dušan's railway map, and an integer k (3 ≤ k ≤ n) representing the shortcutting diameter that he wants to achieve.

Each of the following n - 1 lines will contain two integers u_i and v_i (1 ≤ u_i, v_i ≤ n, u_i ≠ v_i), meaning that there is a railway between cities u_i and v_i.

Output

The first line of the output should contain a number t representing the number of the shortcuts that were added.

Each of the following t lines should contain two integers u_i and v_i, signifying that a shortcut is added between cities u_i and v_i.

Example

Input


10 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10


Output


8
3 7
3 5
3 6
3 1
7 9
7 10
7 4
7 5

Note

Notice that adding a shortcut between all cities and city 1 will make a graph theoretic diameter become 2. On the other hand, the paths obtained that way might not be good, since some of the edges might get duplicated. In the example, adding a shortcut between all cities and city 1 doesn't create a valid solution, because for cities 5 and 10 the path that uses shortcuts 5-1 and 1-10 is not valid because it uses edges 1-2, 2-3, 3-4, 4-5 twice.
#include <bits/stdc++.h>
using namespace std;
int N, K, n, i, j, k, l;
int a[20001][2], ls[10001], sz[10001], len;
int ans[100001][2], tot;
int num[10001], d[10001], Tot;
bool bz[10001];
void New(int x, int y) {
  ++len;
  a[len][0] = y;
  a[len][1] = ls[x];
  ls[x] = len;
}
void Add(int x, int y) {
  ++tot;
  ans[tot][0] = x, ans[tot][1] = y;
}
int dfss(int Fa, int t) {
  int i, sz = 1;
  for (i = ls[t]; i; i = a[i][1])
    if (a[i][0] != Fa && !bz[a[i][0]]) sz += dfss(t, a[i][0]);
  return sz;
}
void dfs(int Fa, int t, int Num) {
  int i;
  sz[t] = 1;
  num[t] = Num;
  for (i = ls[t]; i; i = a[i][1])
    if (a[i][0] != Fa && !bz[a[i][0]]) {
      dfs(t, a[i][0], Num);
      sz[t] += sz[a[i][0]];
    }
  if (sz[t] >= N) d[++Tot] = t, sz[t] = 0;
}
void Dfs(int st, int Fa, int t) {
  int i;
  if (!bz[t]) Add(st, t);
  for (i = ls[t]; i; i = a[i][1])
    if (a[i][0] != Fa && !bz[a[i][0]]) Dfs(st, t, a[i][0]);
}
void work(int t, int Num, int L) {
  int i, j, k, l, R, sz;
  sz = dfss(0, t);
  N = floor(sqrt(sz));
  dfs(0, t, Num);
  R = Tot;
  for (i = L; i <= R - 1; i++)
    for (j = i + 1; j <= R; j++) Add(d[i], d[j]);
  for (i = L; i <= R; i++) bz[d[i]] = 1;
  for (i = L; i <= R; i++) Dfs(d[i], 0, d[i]);
  for (i = L; i <= R; i++) {
    for (j = ls[d[i]]; j; j = a[j][1])
      if (!bz[a[j][0]] && num[a[j][0]] != Num + 1)
        work(a[j][0], Num + 1, Tot + 1);
  }
}
int main() {
  scanf("%d%d", &n, &K);
  for (i = 1; i <= n - 1; i++) scanf("%d%d", &j, &k), New(j, k), New(k, j);
  work(1, 1, 1);
  printf("%d\n", tot);
  assert(tot <= n * 10);
  for (i = 1; i <= tot; i++) printf("%d %d\n", ans[i][0], ans[i][1]);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
