Uniform Circular Motion, one worksheet reads. In his other hand, Max holds another worksheet titled Kinetic Energy and the Work-Energy Theorem. Which to do first? thinks Max, as he sits down in the library...
After coming just on time and narrowly avoiding the ire of Ms. Gugoiu in period one, Max is now on his period two spare! He is trying to catch up on physics homework, but he is not sure which of the two worksheets in his hands he should do first. He checks the course outline, which states something along these lines:
There are worksheets in total, numbered from
to
, as well as
listings on prerequisite worksheets, which are pairs of worksheets
where worksheet
must be completed before worksheet
(or else Max won't understand anything on worksheet
). With this, it can also be determined that if worksheet
is a prerequisite to worksheet
, and worksheet
is a prerequisite to worksheet
, then worksheet
is also a prerequisite to worksheet
.
Max deems a worksheet more important than another worksheet
if the number of worksheets that require
as a prerequisite is more than the number of worksheets that require
as a prerequisite. Can you help Max determine which worksheet is more important so he can prioritize his studying?
Constraints
Input Specification
The first line of input will contain the integers and
.
The next lines will each contain two integers,
and
, stating that worksheet
must be completed before worksheet
. It is guaranteed that worksheet
is not a prerequisite to worksheet
.
The last line of input will contain and
, the two worksheets in Max's hands.
Output Specification
Output A
if worksheet is more important, output
B
if worksheet is more important, and output
Either
if neither is more important than the other.
Sample Input 1
6 5
2 3
3 5
3 4
1 4
4 6
1 2
Sample Output 1
B
Sample Input 2
5 4
1 4
2 3
4 5
2 5
2 1
Sample Output 2
Either
Comments