Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT adj = [ [ ] for i in range ( 10000 ) ] NEW_LINE lvl = [ 0 for i in range ( 10000 ) ] NEW_LINE dist1 = [ - 1 for i in range ( 10000 ) ] NEW_LINE dist2 = [ - 1 for i in range ( 10000 ) ] NEW_LINE end1 , end2 , maxi = 0 , 0 , 0 NEW_LINE DEDENT