import sys def Metoda(x): t = False x.lower() if 'h' in x and 'a'in x and 'c' in x and 'k' in x and 'e' in x and 'r' in x and 'n' in x: t = True return t q = int(input().strip()) for a0 in range(q): s = input().strip() if Metoda(s): print("YES") else: print("NO") # your code goes here