Problem: Nastia has an unweighted tree with n vertices and wants to play with it!

The girl will perform the following operation with her tree, as long as she needs:

  1. Remove any existing edge. 
  2. Add an edge between any pair of vertices. 



What is the minimum number of operations Nastia needs to get a bamboo from a tree? A bamboo is a tree in which no node has a degree greater than 2.

Input

The first line contains a single integer t (1 ≤ t ≤ 10 000) — the number of test cases.

The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5) — the number of vertices in the tree.

Next n - 1 lines of each test cases describe the edges of the tree in form a_i, b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i).

It's guaranteed the given graph is a tree and the sum of n in one test doesn't exceed 2 ⋅ 10^5.

Output

For each test case in the first line print a single integer k — the minimum number of operations required to obtain a bamboo from the initial tree.

In the next k lines print 4 integers x_1, y_1, x_2, y_2 (1 ≤ x_1, y_1, x_2, y_{2} ≤ n, x_1 ≠ y_1, x_2 ≠ y_2) — this way you remove the edge (x_1, y_1) and add an undirected edge (x_2, y_2).

Note that the edge (x_1, y_1) must be present in the graph at the moment of removing.

Example

Input


2
7
1 2
1 3
2 4
2 5
3 6
3 7
4
1 2
1 3
3 4


Output


2
2 5 6 7
3 6 4 5
0

Note

Note the graph can be unconnected after a certain operation.

Consider the first test case of the example: 

<image> The red edges are removed, and the green ones are added.

Solution (in CPP):

Solution:
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <queue>
#include <bitset>
#include <unordered_map>
#include <complex>
#include <random>
#include <chrono>
#include <unordered_set>
using namespace std;
using namespace chrono;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define double long double
#define sqr(x) (x)*(x)
#define pb push_back
typedef int C;
typedef complex<C>P;
#define X real()
#define Y imag()
#define pii pair<int,int>
struct custom_hash {
	static uint64_t splitmix64(uint64_t x) {
		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}
	size_t operator()(uint64_t x) const {
		static const uint64_t fixed_random = steady_clock::now().time_since_epoch().count();
		return splitmix64(x + fixed_random);
	}
};
struct opp {
	int x, y, x1, y1;
};
vector<opp>op;
int dfs(int v, int last,vector<vector<int>>&g) {
	int list = v;
	int rch = 0;
	for (auto& c : g[v]) {
		if (c == last) continue;
		int z = dfs(c, v, g);
		if (z < 0) continue;
		rch++;
		switch (rch) {
			case 1: list = z; break;
			case 2:  op.push_back({last,v,list,z}); list = -1; break; // при соединении list становится листом
			default: op.push_back({ c,v,c,z });
		}
		
	}
	return list;
}
int32_t main()
{
	IOS;
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		op.clear();
		vector<vector<int>>g(n);
		for (int i = 0; i < n - 1; i++) {
			int x, y;
			cin >> x >> y;
			x--; y--;
			g[x].push_back(y); g[y].push_back(x);
		}
		int root = 0;
		while (g[root].size() > 1) root++;//100% есть
 		int list=dfs(root, -1,g);// т.к лист тупо изолируется и про него нельзя забывать
		cout << op.size() << "\n";
		for (auto& c : op) {
			cout << c.x + 1 << " " << c.y + 1 << " " << list+1<< " " << c.y1 + 1 << "\n";
			list = c.x1; 
		}
	}
}