Problem I
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 7 Accepted Submission(s) : 3
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Alice and Bob are both intelligent students, they are always play games with each other. Now, they found a game about logical expression. Logical expression contains several basic operations: and, or, not, xnor, implication. We use K, A, N, E, C, to represent those operations, and the result of the operation in the table below:
We can define logical expression with these operations, for example: KAabNc. At this expression that lowercase letters indicating variables that just can be valued 0 or 1.
For each game, they get a logical expression at first. Then Alice and Bob give a value to a non-valued variable in turn, Alice firstly. Finally, if the value of the logical expression is 1 Alice will win the game, else Bob will win. Alice and Bob are both clever enough.
We can define logical expression with these operations, for example: KAabNc. At this expression that lowercase letters indicating variables that just can be valued 0 or 1.
For each game, they get a logical expression at first. Then Alice and Bob give a value to a non-valued variable in turn, Alice firstly. Finally, if the value of the logical expression is 1 Alice will win the game, else Bob will win. Alice and Bob are both clever enough.
Input
Input contains multiple test cases. Each case in one line, only containing K, A, N, E, C and a to j. The length of the string is between 2 and 100.
Output
For each case, if Alice will win the game, output ’Alice will win’, otherwise, output’ Bob will win’.
Sample Input
KAabNc Eab CKabAab
Sample Output
Alice will win Bob will win Alice will win