Problem: 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.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
using namespace std;
bool dbg = 0;
clock_t start_time = clock();
void bad(string mes = "NO") {
  cout << mes;
  exit(0);
}
void bad(int mes) {
  cout << mes;
  exit(0);
}
template <typename T>
string bin(T x, int st = 2) {
  string ans = "";
  while (x > 0) {
    ans += char('0' + x % st);
    x /= st;
  }
  reverse(ans.begin(), ans.end());
  return ans.empty() ? "0" : ans;
}
mt19937_64 mt_rand(228);
template <typename T1, typename T2>
inline bool upmax(T1& a, T2 b) {
  return (a < b ? (a = b, true) : false);
}
template <typename T1, typename T2>
inline bool upmin(T1& a, T2 b) {
  return (b < a ? (a = b, true) : false);
}
template <typename T>
T input() {
  T ans = 0, m = 1;
  char c = ' ';
  while (!((c >= '0' && c <= '9') || c == '-')) {
    c = getchar();
  }
  if (c == '-') m = -1, c = getchar();
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + (c - '0'), c = getchar();
  }
  return ans * m;
}
template <typename T>
T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
void read(T& a) {
  a = input<T>();
}
template <typename T>
void read(T& a, T& b) {
  read(a), read(b);
}
template <typename T>
void read(T& a, T& b, T& c) {
  read(a, b), read(c);
}
template <typename T>
void read(T& a, T& b, T& c, T& d) {
  read(a, b), read(c, d);
}
const int inf = 1e9 + 20;
const short short_inf = 3e4 + 20;
const long double eps = 1e-12;
const int maxn = (int)10004 + 3, base = 1e9 + 7;
const long long llinf = 2e18 + 5;
const int mod = 1e9 + 7;
int binpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = 1ll * res * a % base;
    a = 1ll * a * a % base;
    n >>= 1;
  }
  return res;
}
vector<int> g[maxn];
bool deleted[maxn];
int sizeOfTree[maxn];
void getTreeSizes(int v, int p = -1) {
  sizeOfTree[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to != p && !deleted[to]) {
      getTreeSizes(to, v);
      sizeOfTree[v] += sizeOfTree[to];
    }
  }
}
int cntLayers = 0;
vector<pair<int, int>> ans;
void fixingWays(int v, int p, int& l, int depth = 0, bool first = false) {
  if (depth > 1 + first) {
    ans.push_back({l, v});
  }
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to != p && !deleted[to]) {
      fixingWays(to, v, l, depth + 1, first);
    }
  }
}
void buildingDfs(int start) {
  getTreeSizes(start);
  int centroid = -1;
  int N = sizeOfTree[start];
  int p = -1, v = start;
  while (centroid == -1) {
    pair<int, int> maxSon = make_pair(0, -1);
    for (int i = 0; i < g[v].size(); i++) {
      int to = g[v][i];
      if (!deleted[to] && to != p) {
        maxSon = max(maxSon, make_pair(sizeOfTree[to], to));
      }
    }
    if (maxSon.first > N / 2) {
      p = v;
      v = maxSon.second;
    } else
      centroid = v;
  }
  int curLayer = cntLayers++;
  if (N > 4) {
    bool first = true;
    for (auto to : g[centroid]) {
      if (!deleted[to]) {
        fixingWays(to, centroid, centroid, 1, first);
        first = false;
      }
    }
  }
  deleted[centroid] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (!deleted[to]) buildingDfs(to);
  }
}
void buildCentroid(int& n) {
  cntLayers = 0;
  for (int i = 0; i < n; i++) {
    deleted[i] = 0;
  }
  buildingDfs(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i + 1 < n; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  buildCentroid(n);
  cout << ans.size() << "\n";
  for (auto [u, v] : ans) {
    cout << u + 1 << ' ' << v + 1 << "\n";
  }
  return 0;
}