LearnPy Hub
← Arena
AdvancedRating 1800

Take One to Three From the Front

Stones with values lie in a row. Alice and Bob alternately take 1, 2 or 3 stones from the front, adding their values to their score. Both play perfectly; Alice starts. Print ALICE, BOB or TIE.

Input

n, then n integers.

Output

ALICE, BOB or TIE.

Sample 1

Input
4
1 2 3 7
Output
BOB

Sample 2

Input
4
1 2 3 -9
Output
ALICE
solution.py
Output appears here
Take One to Three From the Front · Python Arena problem · LearnPy Hub