Mirko and Slavko are the only two contestants at the Grand Prix of Dabrovina Donja which is driven through nearby villages. The villages are connected via one-way roads, and for each road
Mirko has bribed the organisers of the race so they'd pick a route in his favour. Specifically, the organisers are going to pick the shortest route (containing the minimal number of roads) such that Mirko is strictly faster than Slavko on that route. If, by any chance, there are several such routes, the organisers choose the one where Mirko gains maximal advantage.
Input Specification
The first line of input contains two integers
Each of the following
Output Specification
The first and only line of output must contain two integers: the shortest possible route (with the minimal number of roads) such that Mirko wins, and the maximal advantage Mirko can gain on a route of the shortest length.
Please note: The input data will be such that a route which meets the conditions from the text will always exist.
Sample Input 1
3 4
1 2 3 0
2 3 3 0
3 1 0 100
2 1 0 4
Sample Output 1
2 1
Sample Input 2
5 7
1 2 4 1
2 3 5 1
3 1 1 6
1 3 15 5
2 4 7 5
4 5 1 4
5 3 1 0
Sample Output 2
5 2
Comments