Problem ID: 10330

The problem statement does not specify whether there can be more than one link between two regulators. The judge's input most probably does not have such a test case. But some of the input on uDebug does - and the solution on uDebug handles these types of test cases correctly.