提示: 欢迎访问OurACM平台。
Problem 1996 Another Number Game

Accept: 95    Submit: 181
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

PH and XiaoBo are playing a game. In first, they will be given one integer N (1 <= N <= 10^5), then in each turn they could:

(1) If N == 1, then the game ends;

(2) If N is even, then N = N / 2; (Operation I)

(3) Otherwise N = N - 1 (Operation II)

PH and XiaoBo play turn by turn, and the one who could not do any operation (neither Operation I nor Operation II) is lose.

Input

The first line is one integer T indicates the number of the test cases. (T <= 30)

Then for every case, the first line is one name, either “PH” or “XiaoBo” indicates that the one who plays first, then one integer N indicates the number. (1 <= N <= 10^5)

Output

Output one line.

First output “Case idx: ”, here idx is the case number count from 1.

Then output “PH” if PH could win, otherwise output”XiaoBo”.

Sample Input

3 PH 2 XiaoBo 2 PH 3

Sample Output

Case 1: PH Case 2: XiaoBo Case 3: XiaoBo

Source

FOJ有奖月赛-2010年12月

Submit  Back  Status  Discuss