#!/bin/python import sys q = int(raw_input().strip()) lst=['h','a','c','k','e','r','r','a','n','k'] for a0 in xrange(q): s = raw_input().strip() # your code goes here index=0 for c in s: if c == lst[index]: index+=1 if index==10: break if index==10: print 'YES' else: print 'NO'