Chef is examining a string ( S ) and is happy if it contains a contiguous substring of length strictly greater than 2 that consists entirely of vowels. In the English alphabet, the vowels are defined as: a, e, i, o, u.
Problem Statement
Your task is to determine whether Chef is happy or not based on the given string.
Input Format
The first line contains a single integer ( T ) (1 ≤ ( T ) ≤ 1000), the number of test cases.
Each of the next ( T ) lines contains a string ( S ) (3 ≤ |( S )| ≤ 1000), which consists solely of lowercase English letters.
Output Format
For each test case, output:
HAPPY if there exists a contiguous substring longer than 2 characters that consists entirely of vowels.
SAD if no such substring exists.
You may use any combination of uppercase or lowercase letters in your output (e.g., hAppY, happy, HAPPY will all be considered correct).
Constraints
( 1 ≤ T ≤ 1000 )
( 3 ≤ |S| ≤ 1000 )
Examples
Sample Input
text
4
aeiou
abxy
aebcdefghij
abcdeeafg
Sample Output
text
HAPPY
SAD
SAD
HAPPY
Explanation
Test case 1: The string "aeiou" contains the contiguous substring "aeiou", which consists entirely of vowels and has a length greater than 2, so Chef is happy.
Test case 2: The string "abxy" does not contain any contiguous substring of vowels longer than 2, resulting in Chef being sad.
Test case 3: Similarly, the string "aebcdefghij" lacks a suitable contiguous substring, making Chef sad.
Test case 4: The string "abcdeeafg" contains "eea", which is a contiguous substring of vowels and has a length greater than 2, so Chef is happy.
Implementation Instructions
Implement your solution in the /app/ directory of your project.
Important: place your implementation at /app/solution.py so the verifier can run it.