#P. JIXMPII57IFY100#*':
JIXMPII57IFY100#*':
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Statement
For a string , let be the number of distinct non-empty substrings of .
Shohag has a string . Help him find a non-empty string such that is a substring of and is even or state that no such string exists.
A string is a substring of a string if can be obtained from by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.
Format
Input
The first line contains a single integer ( ) — the number of test cases.
The first and only line of each test case contains a string ( ) consisting of lowercase English letters.
It is guaranteed that the sum of the length of over all test cases doesn't exceed .
Output
For each test case, print a non-empty string that satisfies the conditions mentioned in the statement, or if no such string exists. If there are multiple solutions, output any.
Sample
5
dcabaac
a
youknowwho
codeforces
bangladesh
abaa
-1
youknowwho
eforce
bang
ShanghaiTech ACM 炸鱼杯
- 状态
- 已结束
- 规则
- OI
- 题目
- 46
- 开始于
- 2024-12-10 23:00
- 结束于
- 2024-12-15 13:00
- 持续时间
- 110 小时
- 主持人
- 参赛人数
- 112