There is a hacker named "Vijay" who has developed a method to check whether an id at some social networking site is fake or real using its username.
His method includes: if the number of distinct consonent characters in one's user name is odd, then the user is a male, otherwise a female. You are given the string that denotes the user name, please help Vijay to determine the gender of this user by his method. Ignore the vowels.
Note: The input only contains lowercase English alphabets.
Example 1 -
Input
a = "jpmztf"
Output:
SHE!
Explanation:
There are 6 distinct consonent characters in "jpmztf".
These characters are: "j", "p", "m", "z", "t", "f".
So jpmztf is a female and you should print "SHE!".
Example 2 - 
Input :
a = "plkaitw"
Output:
HE!
Explanation : 
There are 5 distinct consonent characters in "plkaitw".
These characters are: "p"," l ","k","t"and"w" as others are vowels.
So plkaitw is a male and you should print "HE!".
 
Your Task :
Complete the function solve() that receives the string a and returns the answer.
 
Expected Time Complexity :O(|a|)
Expected Space Complexity :O(1)
 
Constraints:
1<=Length of string<=1000

Source: geeksforgeeks | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: #User function Template for python3



class Solution:



    def solve(self, a):

        # code here

Solutions:
class Solution:

	def solve(self, a):
		A = set(a)
		B = 'aeiou'
		counter = 0
		for i in A:
			if i not in B:
				counter += 1
		if counter % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		c = ''
		v = 'aeiou'
		for i in a:
			if i not in v:
				c += i
		d = set(c)
		if len(d) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		s = ''.join(set(a))
		c = 0
		for i in s:
			if i not in 'aeiou':
				c += 1
		if c % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		s = ''.join(set(a))
		c = 0
		for i in range(len(s)):
			if s[i] not in ['a', 'e', 'i', 'o', 'u']:
				c += 1
		if c % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		consonants = set()
		for char in a:
			if char.isalpha() and char.lower() not in 'aeiou':
				consonants.add(char.lower())
		num_consonants = len(consonants)
		if num_consonants % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		odd = 0
		vowels = 'aeiou'
		kl = set(a)
		for i in kl:
			if i in vowels:
				continue
			else:
				odd += 1
		return 'SHE!' if odd % 2 == 0 else 'HE!'


class Solution:

	def solve(self, a):
		l = []
		for i in a:
			if i not in l and i not in 'aeiou':
				l.append(i)
		if len(l) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		b = ['a', 'e', 'i', 'o', 'u']
		s = ''
		for i in a:
			if i not in b:
				s += i
		c = len(list(set(s)))
		if c % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		a = list(a)
		v = 'aeiou'
		l = []
		for i in a:
			if i not in v:
				l.append(i)
		if len(set(l)) % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		s = set()
		for i in a:
			if i not in ['a', 'e', 'i', 'o', 'u']:
				s.add(i)
		if len(s) % 2:
			return 'HE!'
		return 'SHE!'


class Solution:

	def solve(self, a):
		s = ['a', 'e', 'i', 'o', 'u']
		count = 0
		ans = set()
		for i in a:
			if i not in s:
				ans.add(i)
		if len(ans) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		record = []
		vowels = ['a', 'e', 'i', 'o', 'u']
		for char in a:
			if char not in vowels and char not in record:
				record.append(char)
		return 'HE!' if len(record) % 2 == 1 else 'SHE!'


class Solution:

	def solve(self, a):
		return 'HE!' if sum([char in 'bcdfghjklmnpqrstvwxyz' for char in set(a)]) % 2 else 'SHE!'


class Solution:

	def solve(self, a):
		count_consonant = 0
		vowels = 'aeiouAEIOU'
		set_a = set(a)
		count_consonant = 0
		for i in set_a:
			if i not in vowels:
				count_consonant += 1
		if count_consonant % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		str1 = ''
		for i in range(len(a)):
			if a[i] not in 'aeiou':
				str1 += a[i]
		str3 = ''
		for i in range(len(str1)):
			if str1[i] not in str3:
				str3 += str1[i]
		c = len(str3)
		if c % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		res = []
		vowels = ['a', 'e', 'i', 'o', 'u']
		for i in a:
			if i not in vowels and i not in res:
				res.append(i)
		if len(res) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		l = ['a', 'e', 'i', 'o', 'u']
		c = 0
		k = []
		for i in a:
			if i not in k:
				k.append(i)
				if i not in l:
					c += 1
		if c % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		p = set(a)
		vowels = ['a', 'e', 'i', 'o', 'u']
		count = 0
		st = ''.join(p)
		for i in st:
			if i not in vowels:
				count += 1
		if count % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		vowel = 'aeiou'
		na = set(a)
		nb = str(na)
		for i in nb:
			if i in vowel:
				nb = nb.replace(i, '')
		if len(nb) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		str = set()
		vowels = 'aouei'
		for x in a:
			if x not in vowels:
				str.add(x)
		if len(str) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		voweles = 'aeiou'
		output = ''
		for item in set(a):
			if item not in voweles:
				output += item
		if len(output) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		vowels = 'aeiou'
		a = a.lower()
		set_a = set(a)
		set_a = set_a
		valor = ''
		for char in set_a:
			if char not in vowels:
				valor += char
		res = len(valor)
		return 'SHE!' if res % 2 == 0 else 'HE!'


class Solution:

	def solve(self, a):
		cnt = 0
		vowels = set('aeiouAEIOU')
		d1 = {}
		for i in a:
			if i not in vowels:
				if i not in d1:
					d1[i] = 1
				else:
					d1[i] += 1
		x = len(list(d1.keys()))
		if x % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		count = 0
		p = set(a)
		a = ''.join(p)
		for i in a:
			if i not in 'aeiou':
				count = count + 1
		return 'SHE!' if count % 2 == 0 else 'HE!'


class Solution:

	def solve(self, a):
		sett = set()
		for i in a:
			if i not in 'aeiou':
				sett.add(i)
		if len(sett) % 2 == 1:
			return 'HE!'
		return 'SHE!'


class Solution:

	def solve(self, a):
		a = list(set(a))
		for (i, v) in enumerate(a):
			if v == 'a' or v == 'e' or v == 'i' or (v == 'o') or (v == 'u'):
				a[i] = ''
		a = ''.join(a)
		return 'SHE!' if len(a) % 2 == 0 else 'HE!'


class Solution:

	def solve(self, s):
		a = set(s)
		l = ['a', 'e', 'i', 'o', 'u']
		c = len(a)
		for i in l:
			if i in a:
				c -= 1
		if c % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		k = list(set(tuple(a)))
		c = 0
		for i in k:
			if i not in 'aeiou':
				c = c + 1
		if c % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		consonants = set('bcdfghjklmnpqrstvwxyz')
		count = 0
		for item in set(a):
			count += item in consonants
		return 'HE!' if count % 2 else 'SHE!'


class Solution:

	def solve(self, a):
		vowels = 'aeiou'
		count = 0
		for i in a:
			if i not in vowels:
				count += 1
				vowels += i
		if count % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		s = set(a)
		c = 0
		v = ['a', 'e', 'i', 'o', 'u']
		for i in s:
			if i not in v:
				c += 1
		if c % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		s = set(a) - {'a', 'e', 'i', 'o', 'u'}
		if len(s) % 2 == 0:
			x = 'SHE!'
		else:
			x = 'HE!'
		return x


class Solution:

	def solve(self, a):
		count = 0
		for i in a:
			a = a.replace('a', '')
			a = a.replace('e', '')
			a = a.replace('i', '')
			a = a.replace('o', '')
			a = a.replace('u', '')
			r = ''
			for i in a:
				if i not in r:
					r += i
			if len(r) % 2 == 0:
				return 'SHE!'
			else:
				return 'HE!'


class Solution:

	def solve(self, a):
		result = {}
		vowels = 'aeiou'
		for i in a:
			if i in vowels:
				continue
			elif i in result:
				result[i] += 1
			elif i not in result:
				result[i] = 1
		if len(result) % 2 != 0:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		b = set((x for x in a))
		v = 0
		for i in b:
			if i not in 'aeiou':
				v += 1
		if v % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


def vow(c):
	if c == 'a' or c == 'e' or c == 'i' or (c == 'o') or (c == 'u'):
		return False
	return True

class Solution:

	def solve(self, a):
		d = {}
		c = 0
		for i in a:
			if i not in d and vow(i):
				d[i] = 1
				c += 1
		if c % 2:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		new_s = str()
		for c in a:
			if c in 'aeiou':
				continue
			if new_s.count(c) < 1:
				new_s += c
		return 'SHE!' if len(new_s) % 2 == 0 else 'HE!'


class Solution:

	def solve(self, a):
		x1 = 0
		for i in set(a):
			if i in 'aeiou':
				continue
			else:
				x1 += 1
		if x1 % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		h = {}
		for i in a:
			h[i] = 1 + h.get(i, 0)
		d = 0
		r = ''
		for i in h:
			if i not in ['a', 'e', 'i', 'o', 'u'] and i not in r:
				r += i
		if len(r) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		x = 'aeiou'
		y = set()
		for i in a:
			if i not in x:
				y.add(i)
		return 'HE!' if len(y) % 2 == 1 else 'SHE!'


import string

class Solution:

	def solve(self, a):
		d = {}
		c = string.ascii_lowercase
		v = ['a', 'e', 'i', 'o', 'u']
		for i in a:
			if i in c and i not in v:
				if i not in d:
					d[i] = 1
		if len(d) % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a: str) -> str:
		vowels = set('aeiou')
		distinct_characters = set()
		for letter in a:
			if letter not in vowels:
				distinct_characters.add(letter)
		if len(distinct_characters) % 2:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, s):
		s = s.replace('a', '')
		s = s.replace('e', '')
		s = s.replace('o', '')
		s = s.replace('i', '')
		s = s.replace('u', '')
		s1 = ''
		for i in s:
			if i not in s1:
				s1 += i
		if len(s1) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		a_set = set(a)
		for vowel in ['a', 'e', 'i', 'o', 'u']:
			try:
				a_set.remove(vowel)
			except:
				pass
		if len(a_set) % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		vowel = 'aeiou'
		dict = {}
		for i in a:
			if i not in vowel:
				if i in dict:
					dict[i] += 1
				else:
					dict[i] = 1
		n = len(dict.keys())
		if n % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		vowels = ['a', 'e', 'i', 'o', 'u']
		result = [letter for letter in a if letter.lower() not in vowels]
		result = ''.join(result)
		c1 = [*set(result)]
		if len(c1) % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		a = set(a)
		vow = 'Aieouaieou'
		res = ''
		for i in a:
			if i not in vow:
				res += i
		return 'SHE!' if len(res) % 2 == 0 else 'HE!'


class Solution:

	def solve(self, a):
		n = ''
		b = 'aeiou'
		c = ''
		for i in a:
			if i not in b:
				c = c + i
		for i in c:
			if i not in n:
				n = n + i
		v = len(n)
		if v % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		s = 'aeiou'
		d = []
		for i in a:
			if i in s:
				continue
			if i not in d:
				d.append(i)
		if len(d) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		a = set(a)
		v = 'aeiou'
		k = ''
		for i in a:
			if i not in v:
				k += i
		if len(k) % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		b = []
		for i in range(0, len(a)):
			if a[i] != 'a' and a[i] != 'e' and (a[i] != 'i') and (a[i] != 'o') and (a[i] != 'u'):
				if a[i] not in b:
					b.append(a[i])
		if len(b) % 2 == 1:
			return 'HE!'
		else:
			return 'SHE!'


class Solution:

	def solve(self, a):
		count = 0
		stri = ''
		for i in a:
			if i not in 'aeiou' and i not in stri:
				count += 1
			stri += i
		if count % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		a = a.replace('a', '')
		a = a.replace('e', '')
		a = a.replace('i', '')
		a = a.replace('o', '')
		a = a.replace('u', '')
		l = len(set(a))
		if l % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		vowels = set(['a', 'e', 'i', 'o', 'u'])
		dis = set()
		for i in a:
			if i not in vowels:
				dis.add(i)
		if len(dis) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		k = []
		s = 'aeiou'
		for i in a:
			if i not in s:
				if i not in k:
					k.append(i)
		if len(k) % 2 == 0:
			return 'SHE!'
		return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		lst = []
		vowel = ['a', 'e', 'i', 'o', 'u']
		for ele in a:
			if ele in vowel:
				continue
			if ele not in lst:
				lst.append(ele)
		if len(lst) % 2 == 1:
			return 'HE!'
		return 'SHE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		s = {'a', 'e', 'i', 'o', 'u'}
		m = {}
		for i in a:
			if i not in s and i not in m:
				m[i] = 1
		if len(m) % 2 == 0:
			return 'SHE!'
		return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		li = list(set(a))
		count = 0
		for i in li:
			if i != 'a' and i != 'e' and (i != 'i') and (i != 'o') and (i != 'u'):
				count += 1
		if count % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		a = [i for i in a if i not in 'aeiou']
		if len(set(a)) % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		lst = list(set(list(a)))
		res = []
		for itr in range(len(lst)):
			if lst[itr] not in ['a', 'e', 'i', 'o', 'u']:
				res.append(lst[itr])
		return 'HE!' if len(res) % 2 != 0 else 'SHE!'
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		a = input()
		solObj = Solution()
		print(solObj.solve(a))


class Solution:

	def solve(self, a):
		s = {''}
		for x in list(a):
			if x not in 'aeiou':
				s.add(x)
		if len(s) % 2 != 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, s):
		t = ''
		for i in s:
			if i not in 'aeiou':
				t += i
		return 'HE!' if len(set(t)) & 1 else 'SHE!'


class Solution:

	def solve(self, a):
		l = {'a', 'e', 'i', 'o', 'u'}
		d = {}
		count = 0
		for i in range(len(a)):
			if a[i] in d:
				d[a[i]] += 1
			else:
				d[a[i]] = 0
		for i in d:
			if i not in l:
				count += 1
		if count % 2 == 0:
			return 'SHE!'
		return 'HE!'


class Solution:

	def solve(self, a):
		a = list(set(a))
		count = 0
		v = ('a', 'e', 'i', 'o', 'u')
		for i in a:
			if a.count(i) > 1:
				a.remove(i)
			if i not in v:
				count += 1
		if count % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		count = 0
		arr = [0] * 26
		for i in a:
			arr[ord(i) - 97] += 1
		for i in range(26):
			if arr[i] > 0:
				if i == 0 or i == 4 or i == 8 or (i == 14) or (i == 20):
					pass
				else:
					count += 1
		if count % 2 == 0:
			return 'SHE!'
		else:
			return 'HE!'


class Solution:

	def solve(self, a):
		new = []
		for i in range(len(a)):
			if a[i] not in 'aeiou':
				new.append(a[i])
		x = set(new)
		if len(x) & 1 == 0:
			return 'SHE!'
		return 'HE!'