Playground Hideout

No attempts yetTime limit1sMemory limit128 MB

Problem

Little Timmy loves playgrounds, especially ones with elaborate wooden towers linked by plank bridges and ropes, with slides and rope-ladders. He would play on his favourite playground for days if his parents let him, but sooner or later they decide it is time to go home. For their next trip Timmy has a plan: instead of letting his father simply grab him, he will climb to the highest platform of the most complex structure and hide there, buying himself some extra time.

An adventure playground consists of several platforms. The difficulty of reaching a platform directly from ground level varies from platform to platform. Platforms are also interconnected by bridges of varying difficulty, and some connections (such as slides) are far easier to use in one direction than in the other.

Given a plan of an adventure playground, help Timmy find the platform that is hardest to reach from ground level. The difficulty of a path is the sum of the difficulties of the connections it uses, and the difficulty of reaching a platform is the difficulty of the least difficult path from ground level to that platform.

Input

The first line contains a single integer nn, the number of test cases.

Each test case begins with a line containing two integers pp and cc (1p,c100001 \le p, c \le 10000), the number of platforms and connections respectively. The next line contains pp integers; the ii-th of them, did_i (0di10000 \le d_i \le 1000), is the difficulty of reaching platform ii directly from ground level.

Each of the following cc lines describes one connection with four integers ii, jj, aa, bb (i<ji < j), where ii and jj are the zero-based indices of the two connected platforms, aa (0a10000 \le a \le 1000) is the difficulty of going from platform ii to platform jj, and bb (0b10000 \le b \le 1000) is the difficulty of going from platform jj to platform ii. There may be multiple connections between the same pair of platforms.

Output

For each test case, first print a line Scenario #i:, where ii is the number of the test case, counting from 1. Then print a single line containing the zero-based index of the platform that is hardest to reach from ground level. If several platforms are equally hard to reach, print the smallest such index. Separate consecutive test cases with a blank line.