문제
Bessie and Elsie are playing a game with a pile of stones that initially contains stones (). The two cows alternate turns, with Bessie going first. When it is a cow's turn, she must remove stones from the pile, where is any positive integer palindrome of the cow's choosing. If the pile is empty when a cow's turn starts, that cow loses.
Definition: A positive integer is a palindrome if it reads the same forward and backward; examples of palindromes include 1, 121, and 9009. Leading zeros are not allowed; e.g., 990 is not a palindrome.
There are () independent test cases. For each test case, print who wins the game if both cows play optimally.
입력
The first line contains , the number of test cases. The next lines describe the test cases, one line per test case.
Each test case is specified by a single integer .
출력
For each test case, output B if Bessie wins the game under optimal play starting with a pile of stones of size , or E otherwise, on a new line.
예제 입력 1
3
8
10
12
예제 출력 1
B
E
B
점수
Inputs 2-4: Inputs 5-7: Inputs 8-10: Inputs 11-13: No additional constraints.
코드를 제출하려면 로그인이 필요합니다.
로그인