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