Taking edges as input and put them in adjacency list representation
for i in range ( q ) : NEW_LINE INDENT x = e [ i ] . u NEW_LINE y = e [ i ] . v ; NEW_LINE v [ x ] . append ( y ) ; NEW_LINE v [ y ] . append ( x ) ; NEW_LINE DEDENT