#!/bin/python3 import sys import re matchobj = re.compile(r'\w*h\w*a\w*c\w*k\w*e\w*r\w*r\w*a\w*n\w*k\w*') q = int(input().strip()) for a0 in range(q): s = input().strip() # your code goes here result = matchobj.match(s) if result is None: print("NO") else: print("YES")