#!/bin/python3 import sys import fnmatch q = int(input().strip()) for a0 in range(q): s = input().strip() if fnmatch.fnmatch(s, '*h*a*c*k*e*r*r*a*n*k*'): print('YES') else: print('NO') # your code goes here