P10816 [HackerEarth] hidden palindrome
普及
题目描述

Little Louis has recently learnt a new word in his English class which reads same from either end. He is curious to find more similar words. His naughty friend poses him a challenge which goes as follows:
He gives him a long word and asks him to find the length of the longest palindromic sub string.

Input Format:

T, the number of test cases.
Following T lines contain the strings.

Output Format:

T lines indicating the length of the longest palindrome.

Constraints: 

1 ≤ T ≤ 1000
1 ≤ STRING LENGTH ≤ 20

SAMPLE INPUT
2
Afsdaydreamaerdyad
Abcbdb

SAMPLE OUTPUT
15
3

输入格式

见题面

输出格式

见题面

样例输入
2 Afsdaydreamaerdyad Abcbdb SAMPLE
样例输出
15 3