Time limit
2s
Memory limit
128 MB
Sejun and Sebi have each raised an army in an online game. Sejun has N soldiers, and Sebi has M soldiers. They are about to go to war.
The war consists of repeated battles. In each battle, one soldier with the smallest strength among all living soldiers dies. If several weakest soldiers all belong to the same side, one of them is chosen arbitrarily and dies. If the weakest strength appears on both sides, one of Sebi's weakest soldiers dies.
The war ends when only one soldier remains. Determine and print the winner of the war.
The first line contains the number of test cases T. T is at most 100.
Each test case consists of three lines.
Each strength is an integer, and a larger value means a stronger soldier. There may be blank lines between test cases.
For each test case, print one winner per line. Print S if Sejun wins, B if Sebi wins, and C if neither side wins.