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