Problem: Abhi and his friends (Shanky,Anku and Pandey) love to play with strings. Abhi invented a simple game. He will give a string S to his friends. Shanky and Anku will play the game while Pandey is just a spectator. Shanky will traverse the string from beginning (left to right) while Anku will traverse from last (right to left). Both have to find the first character they encounter during their traversal,that appears only once in the entire string. Winner will be one whose character is alphabetically more superior(has higher ASCII value). When it is not possible to decide the winner by comparing their characters, Pandey will be the winner.

Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
Each test case contains a string S having only lowercase alphabets ( a..z ).

Output
For each test case, output a single line containing "SHANKY" if Shanky is the winner or "ANKU" if Anku is the winner or "PANDEY" if the winner is Pandey. Output your answer without quotes.

Constraints

1 ≤ T ≤ 100
1 < |S| ≤ 10^5


Example
Input:
3
google
breakraekb
aman

Output:
SHANKY
PANDEY
ANKU


Explanation
Example case 2. Both Shanky and Anku can not find any such character. Hence it is not possible to decide the winner between these two. So Pandey is the winner.

Solution (in PYTHON):

Solution:
import sys

for __ in range(input()) :
    s = map(ord,raw_input())
    mark = [0]*150
    for i in s :
        mark[i] += 1
    frnt , bck = 0 , 0
    for i in s :
        if mark[i] == 1 :
            frnt = i
            break
    for i in reversed(s) :
        if mark[i] == 1 :
            bck = i
            break
    if frnt == 0 or bck == 0 :
        print "PANDEY"
    else :
        if frnt > bck :
            print "SHANKY"
        else :
            if frnt==bck :
                print "PANDEY"
            else :
                print "ANKU"