#672
Gold II
Palindrome Game
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Bessie and Elsie are playing a game with a pile of stones that initially contains SS stones (1S<101051\le S<10^{10^5}). The two cows alternate turns, with Bessie going first. When it is a cow's turn, she must remove xx stones from the pile, where xx 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 TT (1T101\le T\le 10) independent test cases. For each test case, print who wins the game if both cows play optimally.

입력

The first line contains TT, the number of test cases. The next TT lines describe the test cases, one line per test case.

Each test case is specified by a single integer SS.

출력

For each test case, output B if Bessie wins the game under optimal play starting with a pile of stones of size SS, or E otherwise, on a new line.

예제 입력 1

3
8
10
12

예제 출력 1

B
E
B

점수

Inputs 2-4: S<100S<100Inputs 5-7: S<106S<10^6Inputs 8-10: S<109S<10^9Inputs 11-13: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Gold II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.