Selection (part 2) | B

Olympic Medals

In an Olympiad, it s not only the total number of medals that matters. A gold medal is worth more than a silver medal, and a silver medal is worth more than a bronze medal.

A country is placed better than another in the ranking if it has more gold medals. If they tie, the best country is the one with more silver medals. If they tie again, the tiebreaker is the number of bronze medals. You can consider no two countries will tie in all medals.

Given the number of medals of two countries A and B, say which one of them is better placed in the Olympiad's final ranking.


The input consists of two lines. The first one has 3 integers \(G_1\), \(S_1\) and \(B_1\) representing the number of gold, silver and bronze medals of the first country. The second line contains 3 integers \(G_2\), \(S_2\) and \(B_2\), representing the second country.


The output of your program should have only one line. Print the letter "A" if the first country won and "B" if the second country won. No ties will happen.

Sample Input Sample Output
4 3 2
1 3 3
3 5 5
10 0 0