URI Online Judge | 2576

Reversing Arrows

By Dâmi Henrique, INATEL BR Brasil

Timelimit: 2

Bibi and Bibika are playing a simple game where the judge, with each round, makes a drawing with several circles and arrows linking some of them.

Bibi must count the least X number of arrows that need to be inverted to exist at least one path from A to B and Bibika must count the smallest amount Y of inverted arrows to exist at least one path in the opposite direction from B to A. The game who find the lowest value. If there is no path between A > B or B > A, the game ends in a draw, regardless of the number of arrows reversed.

As the judge in some rounds makes a very large drawing, it is quite complicated to check the veracity of the answers given by the girls. Your task is to automate this process for him.


The first line of each test case contains four integers C ( 1 ≤ C ≤ 104 ) , S ( 0 ≤ S ≤ 5 x 105), A e B, ( 1 ≤ A, B ≤ C ), where C is the number of circles, S is the number of arrows, A and B are the ends of the game. Each of the next S lines contain two integers C1 and C2, representing an arrow connecting the circle C1 to the circle C2.


For each test case, display the winner's name and the amount Q inverted arrows in Bibi format: Q or Bibika: Q. If the game ends in a draw, display Bibibibika.

Input Samples Output Samples

6 7 1 5
1 2
1 6
3 2
4 2
4 6
5 4
5 3

Bibika: 1

3 2 1 2
1 2
2 3

Bibi: 0