Palindrome Family - Beta
Submissions: 0   Accuracy:

0%

  Max. Score:

20

Given a string of lowercase characters. You need to detect the family of string, where family of string is described as follows :
Odd Palindrome : String with characters at odd index (1-based indexing) forming Palindrome.
Even Palindrome : String with characters at even index (1-based indexing) forming Palindrome.
TWIN Palindrome : String with both of the above properties.
Parent Palindrome : If the string is itself a Palindrome.

Input :

First line of input contains number of testcases T. For each testcase, there will be a single line containing the string.

Output :

For each testcase, output a single line “ODD”/ “EVEN”/ “TWIN”/ “PARENT” (without quotes). If string is not in the family, print “ALIEN” (without quotes). If the string is not ALIEN then the priority of plaindromes goes like PARENT>TWIN>EVEN/ODD

Constraints :
1 <= T <= 210
1 <= String Length <= 105

Example :
Input :
3
geeks
geeksforskeeg
aibohobia
Output :
ALIEN
ODD
PARENT


to report an issue on this page.