Pawners X88769


Statement
 

pdf   zip

html

Two pawners, Alice and Bob, are struggling for the same piece of the market. Each pawner has some money to survive, but both are losing part of their money every day. If one of them loses all their money, they will be considered out of the market.

Input

The input starts with the number of test cases T ≤ 1000. For each test case, there are four integers A, B, Ca and Cb that correspond to the money of Alice and Bob, and the daily cost for Alice and Bob, respectively.

Constraints

  • 0 ≤ A, B ≤ 10000
  • 0 < Ca, Cb ≤ 100

Output

For each test case, output in a new line the survivor (Alice or Bob), Both or None.

In the first example, they start with 5, the first day Alice has 4 while Bob has 3, the second day they have 3 and 1, and the last day Alice has 2 while Bob loses all his money.

In the second example, Alice and Bob lose all their money on the second day, so the answer is None.

In the third example, nobody is losing money so Both are survivors.

Public test cases
  • Input

    3
    5 5 1 2
    2 2 1 1
    6 7 0 0
    

    Output

    Alice
    None
    Both
    
  • Information
    Author
    Javier Segovia
    Language
    English
    Official solutions
    C++
    User solutions
    C++