#P1394. 山上的国度

山上的国度

Description

A mysterious small country lies atop the verdant mountains in the south. Only at dusk, when the dazzling afterglow of the setting sun pierces the thin mist, can the destined few see the nn beautiful villages on the hill.

Legend says there are mm hub pipelines in this ancient country. Each aged pipeline connects two villages and has carried water for the villagers for centuries.

Among the nn villages there is exactly one reservoir, which supplies water from its village to the others through these hub pipelines. Everyone knows that water flows downhill, and all villages can receive supply from the reservoir.

Huang Xiaoming is one of the destined few, and he is also quite obsessive. He is eager to know in which village the reservoir should be located. Can you help resolve his doubt?

Input Format

The first line contains n,mn, m (n,m300n, m \leq 300).

The second line contains nn positive integers; the ii-th number is the elevation of the ii-th village. Then follow mm lines, each containing two integers indicating that there is a pipeline between those two villages. (No flow is possible between villages of the same elevation.)

Output Format

If such a village exists, output two lines: the first line is Oui, j'ai trouve la solution., and the second line is the index of the village.

Otherwise, output Non.

4 2
1 2 3 4
1 2
3 4

Non

Hint

Translated by ChatGPT 5