Alice has 444 types of coins. The values of the 444 types of coins are 2,3,17,192, 3, 17, 192,3,17,19, respectively. Each kind of coin has an unlimited supply. Bob also has 444 types of coins. The values of the 444 types of coins are 5,7,11,135, 7, 11, 135,7,11,13, respectively. Each kind of coin has an unlimited supply. There are qqq queries. The jjj-th query is described as an integer number xxx. The answer to the query is the minimum number of coins that is necessary to obtain the value xxx using some subset of coins . If it is impossible to obtain the value, the answer to the jjj-th query is 1-11. If both of them can obtain the minimum number, output"both".In the other case, you should output either "A" if Alicecan obtain the minimum number or "B" if Bobcan obtain the minimum number.
Alice has 444 types of coins. The values of the 444 types of coins are 2,3,17,192, 3, 17, 192,3,17,19, respectively. Each kind of coin has an unlimited supply. Bob also has 444 types of coins. The values of the 444 types of coins are 5,7,11,135, 7, 11, 135,7,11,13, respectively. Each kind of coin has an unlimited supply. There are qqq queries. The jjj-th query is described as an integer number xxx. The answer to the query is the minimum number of coins that is necessary to obtain the value xxx using some subset of coins (Alice or Bob). If it is impossible to obtain the value, the answer to the jjj-th query is −1-1−1. If both of them can obtain the minimum number, output "both". In the other case, you should output either "A" if Alice can obtain the minimum number or "B" if Bob can obtain the minimum number.