#!/bin/python import sys q = int(raw_input().strip()) for a0 in xrange(q): s = raw_input().strip() hack = list('hackerrank') hack.reverse() for c in s: if c == hack[-1]: hack.pop() if len(hack) == 0: break if len(hack) == 0: print 'YES' else: print 'NO' # your code goes here