Help me in solving ST08 problem

My issue

My code

# Update the code below to solve the problem

t = int(input())
for i in range(t):
    S = input()
    L1 = len(S)
    flag=0
    V = ['a','e','i','o','u']
    if L1>2:
        for i in S:
            if i in V:
                pass
            else:
                flag=1
                break
    if flag == 1:
        print("Sad")
    else:
        print("Happy")
    
    

Learning course: Python for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone