#!/bin/python import sys ref = "hackerrank" q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here p1, p2 = 0, 0 if len(s) < len(ref): print "NO" else: # at least as long fount = False while p2 < len(s): if p1 == len(ref) - 1: print "YES" fount = True break if s[p2] == ref[p1]: p1 += 1 p2 += 1 if not fount: print "NO"