Abnormal 89’s

A palindrome is a word that can be read the same way in either direction. More formally if a string is d (d > 0) characters length and the i-th character is ai, the string is palindrome if and only if ai equals a(d−i+1) for 1 ≤ i ≤ d. For example “abcba” is palindrome while “aaab” is not. It is known that everyone who gets to know palindromes, begin an emotional relationship with these beautiful strings. The harmony between the letters makes them artistic. But the 89’s (those who entered AUT at 1389) claim they love another kind of strings. It is called alindrome. Actually an alindrome is the result of concatenation of two palindromes. For example “abacc”=“aba”+“cc” is alindrome. Now you should write a program to distinguish alindromes, palindromes and other kind of strings. Input The first line contains T (T ≤ 50), the number of tests. Each test that comes in a separate line contains a string to be checked. Input strings contain only lower case letters (‘a’ to ‘z’) and their length will be at most 200000. Output For each test output a single word in a single line. If the input string can be made by concatenating two palindromes, output ‘alindrome’. Otherwise if it’s a palindrome output ‘palindrome’. In any other case print ‘simple’. (Quotes for clarity) Sample Input 4 aaa aabaa aabaaa abc Sample Output alindrome palindrome alindrome simple