shield-the-world

The Strategic Homeland Intervention Enforcement & Logistics Division (S.H.I.E.L.D) has been taken over by the evil organisation HYDRA. In order to save the world the few remaining loyal S.H.I.E.L.D agents must intercept and destroy all HYDRA communication. Every message of HYDRA is of the following format - a string "S" where count of each character in the string is equal to its alphabetical position value i.e. 'a' is 1, 'b' is 2 ...'z' is 26.
Your task is to find out whether the given message is a HYDRA message or not.

Input Format:

First line contains number of test cases T, followed by T lines, each containing a string "S".

Output Format:

For each test case print "HYDRA" if the String "S" is HYDRA, else print "S.H.I.E.L.D"

Constraints:
1 ≤ T ≤ 100
1 ≤ |S| ≤ 400, S will contains only lower case alphabets ('a'-'z').

SAMPLE INPUT
2
bddbdcdcac
fiurylisvea

SAMPLE OUTPUT
HYDRA
S.H.I.E.L.D

Explanation

In case 1, viz. String "bddbdcdcac" -

The count of character 'a' is 1. Position value of 'a' is also 1.

The count of character 'b' is 2. Position value of 'b' is also 2.

The count of character 'c' is 3. Position value of 'c' is also 3.

Source: hackerearth | Difficulty: EASY


Solutions: