This page is still under construction.

Parts of this page are still being built. What you see may change.

Apples and Bananas

Time limit1sMemory limit128 MB

Summary
Decide the winner of an alternating game where each move removes one apple, one banana, three apples and one banana, or one apple and three bananas from piles of a apples and b bananas.
Level

Medium7 of 10

Topics
Game theory, Dynamic programming, Math
Solved
No attempts yet

Problem

Alice and Bob play a game with a pile of aa apples and bb bananas. Alice moves first, and the two alternate turns. On a turn a player removes exactly one of the following combinations: 11 apple, 11 banana, 33 apples and 11 banana, or 11 apple and 33 bananas. A move is legal only when the pile holds at least that many of each fruit. The player who removes the last fruit wins. When the pile starts empty, Bob wins at once. Given the numbers of apples and bananas and optimal play from both sides, decide whether Alice or Bob wins.

Input

The input holds the apple count aa and the banana count bb, separated by a space. Both satisfy 0≤a,b≤10000 \le a, b \le 1000.

Output

Print the name of the winner under optimal play, either Alice or Bob.

Examples3

  1. Example 1

    Input
    1 0
    
    Expected output
    Alice
    
  2. Example 2

    Input
    2 2
    
    Expected output
    Bob
    
  3. Example 3

    Input
    3 4
    
    Expected output
    Bob