Initialising tree
v [ 1 ] . append ( [ 4 , 4 ] ) NEW_LINE v [ 4 ] . append ( [ 1 , 4 ] ) NEW_LINE v [ 1 ] . append ( [ 2 , 2 ] ) NEW_LINE v [ 2 ] . append ( [ 1 , 2 ] ) NEW_LINE v [ 2 ] . append ( [ 3 , 3 ] ) NEW_LINE v [ 3 ] . append ( [ 2 , 3 ] ) NEW_LINE v [ 2 ] . append ( [ 5 , 5 ] ) NEW_LINE v [ 5 ] . append ( [ 2 , 5 ] ) NEW_LINE queries = [ 1 , 3 , 5 ] NEW_LINE answerQueries ( queries ) NEW_LINE