#!/bin/python import sys import re q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here r = re.findall('.*h.*a.*c.*k.*e.*r.*r.*a.*n.*k.*', s) print 'YES' if len(r) else 'NO'