Given a connected acyclic graph with N nodes and N-1 edges, find out the pair of nodes that are at even distance from each other.

**Input:**

The first line of input contains an integer T denoting the number of test cases.

First line of each test case contains a single integer N denoting the number of nodes in graph.

Second line of each test case contains N-1 pair of nodes xi , yi denoting that there is an edges between them.

**Output:**

For each test case output a single integer denoting the pair of nodes which are at even distance.

**Constraints:**

1<=T<=10

1<=N<=10000

1<=xi,yi<=N

**Example**

**Input**

1

3

1 2 2 3

**Output**

1

**Explanation:**

Only such pair is (1,3) where distance b/w them is 2

Author: pra1nay7_313

EasySawalKiAukatHaiBas | 480 |

RohitBattu | 152 |

piyushmittal25 | 128 |

may55 | 118 |

aman19 | 116 |

AdityaSharma16 | 490 |

EasySawalKiAukatHaiBas | 480 |

saumitra13325 | 426 |

ashujack | 377 |

R_H | 352 |

blackshadows | 5102 |

akhayrutdinov | 5099 |

Ibrahim Nash | 5071 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.