#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() counter=0 lst=list("hackerrank") for i in s: if counter==10: break if i==lst[counter]: counter+=1 if counter==10: print "YES" else: print "NO" # your code goes here