P1394 The Kingdom on the Mountain

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 $n$ beautiful villages on the hill. Legend says there are $m$ hub pipelines in this ancient country. Each aged pipeline connects two villages and has carried water for the villagers for centuries. Among the $n$ 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, m$ ($n, m \leq 300$). The second line contains $n$ positive integers; the $i$-th number is the elevation of the $i$-th village. Then follow $m$ 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`.

Explanation/Hint

Translated by ChatGPT 5