The first line of input contains a single integer T – a number of
test cases. Every test case starts with a line containing two integers
separated by a single space – N and M. Each of the next M lines will
contain two integers ai and bi separated by a single space – the labels
of cities that i-th road connects.