#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() # your code goes here comp = 'hackerrank' i = j = 0 while i < len(comp) and j < len(s): if comp[i] == s[j]: i += 1 j += 1 if i == len(comp): print 'YES' else: print 'NO'