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.io.*;
    import java.text.DecimalFormat;
    import java.util.*;
    public class main2 {
    	static ArrayList<pair> factors;
    	static boolean isComposite[];
    	static ArrayList<Integer> primes;
    	public static boolean isprime(long n){
    		if(n<=10001){
    			return !isComposite[(int)n];
    		}
    		for(int i=0;i<primes.size();i++){
    			if(primes.get(i)*primes.get(i)*1l>n){
    				break;
    			}
    			if(n%primes.get(i)==0){
    				return false;
    			}
    			
    		}
    		return true;
    	}
    	static int[] res;
    	
    	public static void sieve(int n){
    		isComposite=new boolean[n+1];
    		primes =new ArrayList<Integer>();
    		isComposite[0]=true;
    		isComposite[1]=true;
    		for(int i=2;i<=n;i++){
    			if(!isComposite[i]){
    				for(int j=2*i;j<=n;j=j+i){
    					isComposite[j]=true;
    				}
    			}
    			primes.add(i);
    		}
    		
    	}
    	public static void primefactors(long n){
    		 factors=new ArrayList<pair>();
    		for(int x:primes){
    			if(x*x*1l>n){
    				break;
    			}
    		
    			
    			if(n%x==0){
    				
    					pair p=new pair(x,0);
    					 factors.add(p);
    				while(n%x==0){
    				n/=x;
    				p.y++;}
    				
    			}
    		}
    		if(n!=1){
    			factors.add(new pair((int)n,1));
    		}
    		
    	}
    	public static long powfact(long n,long p){
    		int res=0;
    		for(long i=p;i*1l<=n;i=i*p*1l){
    			res+=(n/i);
    		}
    		return res;
    	}
    	
    	public static long GCD(long i, long j){
    	if (i==0){
    		return j;
    	}
    	return GCD(j%i,i);
    	}
    	public static long LCM(long i, long j){
    		return(i*j)/GCD(i,j);
    	}
     
     
    	public static void main(String[] args) throws Exception {
    	Scanner sc=new Scanner(System.in);
    int t=sc.nextInt();
    while(t-->0){
    	 n=sc.nextInt();
adjlist= (ArrayList<Integer>[]) new ArrayList[n];
for(int i=0;i<n;i++){
	adjlist[i]=new ArrayList<Integer>();
}
leaves=new int[n];
for(int i=0;i<n-1;i++){
	int u=sc.nextInt()-1;
	int v=sc.nextInt()-1;
	adjlist[u].add(v);
	adjlist[v].add(u);
}
dfs1(0,-1);
centroid=new PriorityQueue<pair>();
dfs(0,-1);
pair x=centroid.poll();

pair y=centroid.poll();
 

if(x.x!=y.x){
	int k=adjlist[x.y].get(0)+1;
	System.out.println(x.y+1+" "+k);
	System.out.println(x.y+1+" "+k);
}
else{
	int u,v,k=0;
	if(leaves[x.y]>leaves[y.y]){
		 u=x.y;
		 v=y.y;
	}
	else{
		 u=y.y;
		 v=x.y;
	}
	for(int i=0;i<adjlist[v].size();i++){
		if(adjlist[v].get(i)!=u){
			k=adjlist[v].get(i)+1;
			break;
		}}
	System.out.println(v+1+" "+k);
	System.out.println(u+1+" "+k);
		
	}
}
    }
     
     
    	
    	static int n;
    	static ArrayList<Integer > [] adjlist;
    	static int [] leaves;
    	static PriorityQueue<pair> centroid;
    	
    	public static void dfs1(int u,int p){
    		leaves[u]=1;
    		if(adjlist[u].size()==1&&u!=0){
    			
    			return;
    		}
    		for( int x:adjlist[u]){
    			if(x!=p){
    				dfs1(x,u);
    				leaves[u]+=leaves[x];
    			}
    		}
    	}
    	public static void dfs(int u,int p){
    		if(adjlist[u].size()==1&&u!=0){
    			centroid.add(new pair(n-1,u));
    			return;
    		}
    		int ans=n-leaves[u];
    		for(int x:adjlist[u]){
    			if(x!=p){
    			ans=Math.max(ans, leaves[x]);
    			dfs(x,u);
    			
    			}
    		}
    		centroid.add(new pair(ans,u));
    		}
    	
    	static class pair implements Comparable<pair>{
    		int x;
    		int y;
    		public pair(int x, int y){
    			this.x=x;
    					this.y=y;
    		}
			@Override
			public int compareTo(pair o) {
				// TODO Auto-generated method stub
				return x-o.x;
			}
    	}
    	
    	  	 	static class SegmentTree{
    	   	 		int[] arr , sTree;
    	   	 	static	int N;
    	   	 		public SegmentTree(int[] in){
    	   	 			arr=in;
    	   	 		N=arr.length-1;
    	   	 			sTree=new int[2*N];
    	   	 			
    	   	 			build(1,1,N);
    	   	 		}
    	   	 		public void build(int node, int l, int r){
    	   	 			if(l==r){
    	   	 				sTree[node]=arr[l];
    	   	 			}
    	   	 			else{
    	   	 				int leftchild=node*2;
    	   	 				int rightchild=node*2+1;
    	   	 				int mid =(l+r)/2;
    	   	 				build(leftchild,l,mid);
    	   	 				build(rightchild,mid+1,r);
    	   	 				sTree[node]=sTree[leftchild]&sTree[rightchild];
    	   	 			}
    	   	 		}
    	   	 		public  void update(int i, int val){
    	   	 			int node =i+N-1;
    	   	 			arr[i]=val;
    	   	 			sTree[node]=val;
    	   	 			node=node/2;
    	   	 			while(node>0){
    	   	 			int leftchild=node *2;
       	 				int rightchild=node*2+1;
       	 			sTree[node]=sTree[leftchild]&sTree[rightchild];
       	 			node=node/2;
    	   	 			}
    	   	 			return;
    	   	 			
    	   	 		}
    	   	 		public int query(int i, int j){
    	   	 			 return query(1,1, N,  i, j);
    	   	 		}
    	   	 		public int query(int node,int l, int r, int i , int j){
    	   	 			if(i>r||j<l){
    	   	 				return 1<<30;
    	   	 			}
    	   	 			if(i<=l&&r<=j){
    	   	 				return sTree[node];
    	   	 			}
    	   	 		int leftchild=node*2;
    	 				int rightchild=node*2+1;
    	 				int mid =(l+r)/2;
    	 				
    	 			return	query(leftchild,l,mid,i,j)&query(rightchild,mid+1,r,i,j);
    	 				
    	   	 		}
    	   	 	}
     
     
    	static class Scanner {
    		StringTokenizer st;
    		BufferedReader br;
     
    		public Scanner(InputStream s) {
    			br = new BufferedReader(new InputStreamReader(s));
    		}
     
    		public boolean hasNext() {
    			// TODO Auto-generated method stub
    			return false;
    		}
     
    		public String next() throws IOException {
    			while (st == null || !st.hasMoreTokens())
    				st = new StringTokenizer(br.readLine());
    			return st.nextToken();
    		}
     
    		public int nextInt() throws IOException {
    			return Integer.parseInt(next());
    		}
     
    		public long nextLong() throws IOException {
    			return Long.parseLong(next());
    		}
     
    		public String nextLine() throws IOException {
    			return br.readLine();
    		}
     
    		public double nextDouble() throws IOException {
    			String x = next();
    			StringBuilder sb = new StringBuilder("0");
    			double res = 0, f = 1;
    			boolean dec = false, neg = false;
    			int start = 0;
    			if (x.charAt(0) == '-') {
    				neg = true;
    				start++;
    			}
    			for (int i = start; i < x.length(); i++)
    				if (x.charAt(i) == '.') {
    					res = Long.parseLong(sb.toString());
    					sb = new StringBuilder("0");
    					dec = true;
    				} else {
    					sb.append(x.charAt(i));
    					if (dec)
    						f *= 10;
    				}
    			res += Long.parseLong(sb.toString()) / f;
    			return res * (neg ? -1 : 1);
    		}
     
    		public boolean ready() throws IOException {
    			return br.ready();
    		}
     
    	}}