Problem: Fishing Prince loves trees, and he especially loves trees with only one centroid. The tree is a connected graph without cycles.

A vertex is a centroid of a tree only when you cut this vertex (remove it and remove all edges from this vertex), the size of the largest connected component of the remaining graph is the smallest possible.

For example, the centroid of the following tree is 2, because when you cut it, the size of the largest connected component of the remaining graph is 2 and it can't be smaller.

<image>

However, in some trees, there might be more than one centroid, for example:

<image>

Both vertex 1 and vertex 2 are centroids because the size of the largest connected component is 3 after cutting each of them.

Now Fishing Prince has a tree. He should cut one edge of the tree (it means to remove the edge). After that, he should add one edge. The resulting graph after these two operations should be a tree. He can add the edge that he cut.

He wants the centroid of the resulting tree to be unique. Help him and find any possible way to make the operations. It can be proved, that at least one such way always exists.

Input

The input consists of multiple test cases. The first line contains an integer t (1≤ t≤ 10^4) — the number of test cases. The description of the test cases follows.

The first line of each test case contains an integer n (3≤ n≤ 10^5) — the number of vertices.

Each of the next n-1 lines contains two integers x, y (1≤ x,y≤ n). It means, that there exists an edge connecting vertices x and y.

It's guaranteed that the given graph is a tree.

It's guaranteed that the sum of n for all test cases does not exceed 10^5.

Output

For each test case, print two lines.

In the first line print two integers x_1, y_1 (1 ≤ x_1, y_1 ≤ n), which means you cut the edge between vertices x_1 and y_1. There should exist edge connecting vertices x_1 and y_1.

In the second line print two integers x_2, y_2 (1 ≤ x_2, y_2 ≤ n), which means you add the edge between vertices x_2 and y_2.

The graph after these two operations should be a tree.

If there are multiple solutions you can print any.

Example

Input


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


Output


1 2
1 2
1 3
2 3

Note

Note that you can add the same edge that you cut.

In the first test case, after cutting and adding the same edge, the vertex 2 is still the only centroid.

In the second test case, the vertex 2 becomes the only centroid after cutting the edge between vertices 1 and 3 and adding the edge between vertices 2 and 3.

Solution (in JAVA):

Solution:
import java.util.*;		
import java.util.function.Function;
import java.util.stream.Collectors;
import java.io.*;
import java.math.*;
public class Main7{
	static public void main(String args[])throws IOException{
		int tt=i();
		StringBuilder sb=new StringBuilder();
		for(int ttt=1;ttt<=tt;ttt++){
			int n=i();
			int[] x=new int[n-1];
			int[] y=new int[n-1];
			graph=new ArrayList<>();
			for(int i=0;i<n;i++){
				graph.add(new ArrayList<>());
			}
			for(int i=0;i<n-1;i++){
				x[i]=i()-1;
				y[i]=i()-1;
				graph.get(x[i]).add(y[i]);
				graph.get(y[i]).add(x[i]);
			}
			boolean[] visited=new boolean[n];
			min=Integer.MAX_VALUE;
			dp=new int[n];
			dfs(0,visited);
			visited=new boolean[n];
			dfs2(0,visited);
			visited=new boolean[n];
			ar1=new ArrayList<>();
			dfs1(0,visited);
			if(ar1.size()==1){
				sb.append((x[0]+1)+" "+(y[0]+1)+"\n");
				sb.append((x[0]+1)+" "+(y[0]+1)+"\n");
			}else{
				int num=ar1.get(0);
				ArrayList<Integer> ar=graph.get(num);
				ArrayList<Integer> ss=new ArrayList<>();
				int index=0;
				for(int i=0;i<ar.size();i++){
					int num1=ar.get(i);
					if(num1!=ar1.get(1)){
						int size=graph.get(num1).size();
						if(size==min){
							index=num1;
							break;
						}else{
							index=num1;
						}
					}
				}
				Queue<Pair> queue=new LinkedList<>();
				visited=new boolean[n];
				queue.add(new Pair(num,index));
				visited[index]=true;
				int xx=num;
				int yy=index;
				while(queue.isEmpty()==false){
					Pair tmp=queue.poll();
					ArrayList<Integer> aa=graph.get(tmp.y);
					if(aa.size()==0){
						xx=tmp.x;
						yy=tmp.y;
						break;
					}
					for(int i=0;i<aa.size();i++){
						if(visited[aa.get(i)]==false && aa.get(i)!=num){
							visited[aa.get(i)]=true;
							queue.add(new Pair(tmp.y,aa.get(i)));
						}
					}
				}
				sb.append((xx+1)+" "+(yy+1)+"\n");
				sb.append((ar1.get(1)+1)+" "+(yy+1)+"\n");
			}
		}
		System.out.print(sb.toString());
	}
	static ArrayList<Integer> ar1;
	static void dfs1(int src, boolean[] visited){
		visited[src]=true;
		ArrayList<Integer> ar=graph.get(src);
		int tmpMax=0;
		int pp=0;
		for(int i=0;i<ar.size();i++){
			int num=ar.get(i);
			if(visited[num]==false){
				tmpMax=Math.max(dp[num],tmpMax);
				pp+=dp[num];
			}
		}
		
		tmpMax=Math.max(visited.length-1-pp,tmpMax);
		if(min==tmpMax){
			ar1.add(src);
		}
		for(int i=0;i<ar.size();i++){
			int num=ar.get(i);
			if(!visited[num]){
				dfs1(num,visited);
			}
		}
	}
	static void dfs2(int src, boolean[] visited){
		visited[src]=true;
		ArrayList<Integer> ar=graph.get(src);
		int tmpMax=0;
		int pp=0;
		for(int i=0;i<ar.size();i++){
			int num=ar.get(i);
			if(visited[num]==false){
				tmpMax=Math.max(dp[num],tmpMax);
				pp+=dp[num];
			}
		}
		tmpMax=Math.max(visited.length-1-pp,tmpMax);
		min=Math.min(min,tmpMax);
		for(int i=0;i<ar.size();i++){
			int num=ar.get(i);
			if(!visited[num]){
				dfs2(num,visited);
			}
		}
	}
	static int[] dp;
	static int min=Integer.MAX_VALUE;
	static int dfs(int src, boolean[] visited){
		visited[src]=true;
		ArrayList<Integer> ar=graph.get(src);
		int tmp=1;
		for(int i=0;i<ar.size();i++){
			int num=ar.get(i);
			if(!visited[num]){
				tmp+=dfs(num,visited);
			}
		}
		dp[src]=tmp;
		return tmp;
	}
	static InputReader in=new InputReader(System.in);
	static OutputWriter out=new OutputWriter(System.out);
	static ArrayList<ArrayList<Integer>> graph;
	static int mod=1000000007;
	static class Pair{
		int x;
		int y;
		Pair(int x,int y){
			this.x=x;
			this.y=y;
		}
		/*@Override
		public int hashCode() 
		{ 
			final int temp = 14; 
			int ans = 1; 
			ans =x*31+y*13; 
			return (int)ans;
		}
       @Override
        public boolean equals(Object o) 
        { 
            if (this == o) { 
                return true; 
            } /
            if (o == null) { 
                return false; 
            } 
            if (this.getClass() != o.getClass()) { 
                return false; 
            } 
            Pair other = (Pair)o; 
            if (this.x != other.x || this.y!=other.y) { 
                return false; 
            } 
            return true; 
        }*/
	}
	public static long[] sort(long[] a){
		int n=a.length;
		ArrayList<Long> ar=new ArrayList<>();
		for(int i=0;i<a.length;i++){
			ar.add(a[i]);
		}
		Collections.sort(ar);
		for(int i=0;i<n;i++){
			a[i]=ar.get(i);
		}
		return a;
	}
	public static long pow(long a, long b){
        long result=1;
        while(b>0){
            if (b % 2 != 0){
                result=(result*a);
                b--;
            } 
            a=(a*a);
            b /= 2;
        }   
        return result;
    }
	public static int gcd(int a, int b){
        if (a == 0){
            return b;
		}
        return gcd(b%a, a);
    }
	public static int lcm(int a, int b){
		return a*(b/gcd(a,b));
	}
	public static long l(){
		String s=in.String();
		return Long.parseLong(s);
	}
	public static void pln(String value){
		System.out.println(value);
	}
	public static int i(){
		return in.Int();
	}
	public static String s(){
		return in.String();
	}
}
class InputReader 
{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;
	public InputReader(InputStream stream) {
		this.stream = stream;
	}
	public int read() {
		if (numChars== -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	public int Int() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	public String String() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	} 
	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	} 
	public String next() {
		return String();
	} 
	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}
class OutputWriter {
	private final PrintWriter writer;
	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}
	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}
	public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}
	public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}
	public void close() {
		writer.close();
	}
	public void flush() {
		writer.flush();
	}
 }
class IOUtils {
	public static int[] readIntArray(InputReader in, int size) {
		int[] array = new int[size];
		for (int i = 0; i < size; i++)
			array[i] = in.Int();
		return array;
	}
}