Alice and Bob's Palindrome Game
Alice and Bob play a game on a string. They take turns removing exactly one character from either the left or right end of the string, starting with Alice. A player wins immediately if, after their move, the remaining string is a palindrome. Determine the winner if both play optimally.
Input
The first line contains an integer n (1 ≤ n ≤ 2000), the length of the string.
The second line contains a string s of length n consisting of lowercase English letters.
Output
Print Alice if Alice wins, or Bob if Bob wins.
Notes
A string is a palindrome if it reads the same forwards and backwards. An empty string is considered a palindrome.
In the first example, s = "abc". Alice can remove either end. If she removes 'a' to get "bc" (not a palindrome), Bob then plays on "bc". If she removes 'c' to get "ab" (not a palindrome), Bob plays on "ab". With optimal play from both, Bob can force a win.
In the second example, s = "aa". Alice can remove either 'a' to get "a", which is a palindrome. So Alice wins immediately.