P13899 [CodeChef] plgrm
NOI
题目描述

For Turbo C++ Users : Read the following document before attempting the question :

Problem Description

N-Boy is very eccentric when it comes to strings. These days, he spends most of his time studying palindromes and pangrams (for his IP assignment at IIITD). For those of you who don’t know, a palindrome is a word or a statement which can be read the same way, forward or backward, and a pangram is a word or a statement containing all letters of the English alphabet.
Now, he is given a set of strings, and he wants to segregate them into palindromes, pangrams and palingrams, which are palindromic pangrams. Unfortunately, he is unable to do so, and has asked you for help.

Input
The first line consists of a single integer T, denoting the number of test cases.
Each test case consists of a string S of lowercase English characters. 

Output
For each test case, output a single line containing a string(without quotes) as follows:

If the string is only a palindrome, print ‘palindrome’.
If the string is only a pangram, print ‘pangram’.
If it is a palingram, print ‘palingram’.
Else, print ‘none’.

Constraints

1 ≤ T ≤ 1000
1 ≤ |S| ≤ 1000

Example
Input:
3
abba
abcdefghijklmnopqrstuvwxyz
qwerty

Output:
palindrome
pangram
none

输入格式

见题面

输出格式

见题面

样例输入
3 abba abcdefghijklmnopqrstuvwxyz qwerty
样例输出
palindrome pangram none