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:
# cook your code here
T = int(raw_input())
for i in range(T):
    s = raw_input()
    l = [0 for j in range(26)]
    length = len(s)
    for j in range(length):
        index = ord(s[j])-97
        l[index] = l[index]+1
    flag = 0
    x = 0
    y = 0
    for j in range(length):
        x = ord(s[j])-97
        if l[x]==1:
            flag =1
            break
    if flag == 0:
        print "PANDEY"
    else:
        for j in range(length):
            y = ord(s[length-j-1])-97
            if l[y]==1:
                break
        if x>y:
            print "SHANKY"
        elif y>x:
            print "ANKU"
        else:
            print "PANDEY"